function LightClose(){
	$("div.HideMe").fadeOut("slow");
	$("div.HideMe2").fadeOut("slow");
}
function LightOpen(val, desc){	
	$("div.HideMe").fadeIn("slow");
	$("div.HideMe2").fadeIn("slow");
	
	var jImg = document.getElementById('LightImg');
	var jDesc = document.getElementById('PhotoDesc');	
	jImg.setAttribute("class","content");
	jImg.src=val;
	if(desc == ''){}
	else{jDesc.innerHTML = desc;}
}
	//PDF-Viewer xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
	function PDF_SHOW(val){
		$("div.PDF_BG_SHOW").fadeIn("slow");
		$("div.PDF_Container").fadeIn("slow");
		//alert(val);
		document.getElementById('PDF_IFRAME').src= 'http://www.monstersproduction.com/'+val;
	}	
	function PDF_CLOSE(){
		$("div.PDF_BG_SHOW").fadeOut("slow");
		$("div.PDF_Container").fadeOut("slow");	
		document.getElementById('PDF_IFRAME').src= "";		
	}
	function popitup() {
		var x = document.getElementById('LightImg');
		var y = x.src;
		var jWidth = x.width;
		var jHeight = x.height;
		url = y;
		newwindow=window.open(url,'SlideShow','height='+jHeight+',width='+jWidth);
		if (window.focus) {newwindow.focus()}
		return false;
	}
	function popitupPresswire() {
		var x = document.getElementById('PDF_IFRAME');
		var y = x.src;
		url = y;
		newwindow=window.open(url,'Presswire',"scrollbars=1,location=0,directories=0,status=0,width=900,height="+screen.height+",toolbar=0,menubar=0,resizable=0");
		
		if (window.focus) {newwindow.focus()}
		return false;
	}
	//CB Arrange CALENDAR xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx	 
	function CalCB_ArrangeLIST(str, selected){
	var x = document.getElementById('CalMonth');
	x.disabled=true;					
	x.options[x.selectedIndex].text="...";
	
	var jVAL = str;
	var target = "";
	
	if(selected == 'CalMonth'){
		target = 'Year';
	}
	else{
		target = 'Month';	
	}
	if (window.XMLHttpRequest)
	  {// code for IE7+, Firefox, Chrome, Opera, Safari
	  xmlhttp=new XMLHttpRequest();
	  }
	else
	  {// code for IE6, IE5
	  xmlhttp=new ActiveXObject("Microsoft.XMLHTTP");
	  }
	xmlhttp.onreadystatechange=function(){
	  if (xmlhttp.readyState==4 && xmlhttp.status==200)
		{
		document.getElementById('CalMonth').innerHTML=xmlhttp.responseText;
		x.disabled=false;
		}
	  }
	var queryString =  "&jVAL=" + jVAL + "&target=" + target + "&selected=" + selected;
	 
	xmlhttp.open("GET", "CalgetListForCB.php?" + queryString, true);
	xmlhttp.send();
	}
	
	//CB Arrange xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx	 
	function CB_ArrangeLIST(str, selected){
	document.getElementById('Brand').disabled=true;
	document.getElementById('Brand').options[document.getElementById('Brand').selectedIndex].text="...";
	var x = document.getElementById('Month');
	x.disabled=true;					
	x.options[x.selectedIndex].text="...";
	
	var jVAL = str;
	var target = "";
	
	if(selected == 'Month'){
		target = 'Year';
	}
	else{
		target = 'Month';	
	}
	
	if (window.XMLHttpRequest)
	  {// code for IE7+, Firefox, Chrome, Opera, Safari
	  xmlhttp=new XMLHttpRequest();
	  }
	else
	  {// code for IE6, IE5
	  xmlhttp=new ActiveXObject("Microsoft.XMLHTTP");
	  }
	xmlhttp.onreadystatechange=function(){
	  if (xmlhttp.readyState==4 && xmlhttp.status==200)
		{
		document.getElementById(target).innerHTML=xmlhttp.responseText;
		x.disabled=false;
		CB_ArrangeBrandLIST(jVAL, selected);
		}
	  }
	var queryString =  "&jVAL=" + jVAL + "&target=" + target + "&selected=" + selected;
	 
	xmlhttp.open("GET", "getListForCB.php?" + queryString, true);
	xmlhttp.send();
	}	
	//Brand CB Arrange xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx	 
	function CB_ArrangeBrandLIST(str, selectedCB){
	var jYear = document.getElementById('Year').value;
	var x = document.getElementById('Brand');
	x.disabled=true;					
	x.options[x.selectedIndex].text="...";
	jSelected = selectedCB;
	var jVAL = str;
	
	if (window.XMLHttpRequest)
	  {// code for IE7+, Firefox, Chrome, Opera, Safari
	  xmlhttp=new XMLHttpRequest();
	  }
	else
	  {// code for IE6, IE5
	  xmlhttp=new ActiveXObject("Microsoft.XMLHTTP");
	  }
	xmlhttp.onreadystatechange=function(){
	  if (xmlhttp.readyState==4 && xmlhttp.status==200)
		{
		x.innerHTML=xmlhttp.responseText;
		x.disabled=false;
		}
	  }
	var queryString =  "&jVAL=" + jVAL + "&jSelected=" + jSelected + "&jYear=" + jYear;
	 
	xmlhttp.open("GET", "getListForBrandCB.php?" + queryString, true);
	xmlhttp.send();
	}	
	//Check Fields
			function CheckMe(){
				for (i=1;i<=3;i++){
					var x = document.getElementById('element_'+i);
						if(x.value == ''){
							x.setAttribute('class','bad');
							alert('NULL FIELD IS INVALID');
							return false;
						}
						else{
							x.setAttribute('class','good');
						}
				}
				document.getElementById('uploadIndicator').setAttribute('class','windowContainer');
			}	
