MOON
Server: Apache/2.2.21 (Unix) mod_ssl/2.2.21 OpenSSL/0.9.8e-fips-rhel5 mod_auth_passthrough/2.1 mod_bwlimited/1.4
System: Linux vps.panamaemb.org.sg 3.10.0-1160.80.1.vz7.191.4 #1 SMP Thu Dec 15 20:31:06 MSK 2022 x86_64
User: panama (500)
PHP: 5.2.17
Disabled: NONE
Upload Files
File: /home/panama/public_html_old/managesite/js/MyFunctions.js
//------------------------------------------------------------------------------------------------------------
//following 2 function performed for control panel. to change tr color 
	function changeColor(value)
	{
		document.getElementById(value).className="trChangeBackgroundColor";
	}
	//------------------------------------------------------------------------------------------------------------
	function defualtColor(value)
	{
		document.getElementById(value).className="trDefualtBackgroundColor";
	}

//------------------------------------------------------------------------------------------------------------
//following 2 function used change left link background color 
	function setcolor(value)
	{ document.getElementById(value).className="menu-headernew"; }
	
	function resetcolor(value)
	{ document.getElementById(value).className="menu-header";	}	


//------------------------------------------------------------------------------------------------------------
//following function performed for control panel file name is user_authorities.php work show hide table and change arrows
	function makeActive(id,arrow_s)
	{
		if (document.getElementById)
		{
			if(document.getElementById(id).style.display == 'none')
			{
			document.getElementById(arrow_s).src = "img/caret-t.gif";
			document.getElementById(id).style.display = 'block';
			} 
			else 
			{
				document.getElementById(arrow_s).src = "img/caret-d.gif";
				document.getElementById(id).style.display = 'none';
			}
		}
	}
//------------------------------------------------------------------------------------------------------------
//------------------------------------------------------------------------------------------------------------
//following function use for control panel for sub group combo hide and show
	function showhide(id)
	{
		if(document.getElementById(id).style.display == 'none')
		{
			document.getElementById(id).style.display = 'block';
		}
		else
		{
			document.getElementById(id).style.display = 'none';
		}
	}
//------------------------------------------------------------------------------------------------------------
//------------------------------------------------------------------------------------------------------------
//when user delete any row
	function delete_row(next_url)
	{
		if(confirm("Are you sure want to delete") == true)
		{
			location.href=next_url;
		}
	}
	
	function delete_yesno($name)
	{
		return confirm("Are you sure want to delete"+ " " +$name);
	}
//------------------------------------------------------------------------------------------------------------
//------------------------------------------------------------------------------------------------------------	
	function chkAllList($id,$val)
	{
		var $table = document.getElementById($id);
		var $cell = $table.getElementsByTagName("input");
		for($i=0;$i < $cell.length;$i++)
		{
			if($val == true)
			$cell[$i].checked=true;
			else
			$cell[$i].checked=false;
		}
	}
//------------------------------------------------------------------------------------------------------------
//------------------------------------------------------------------------------------------------------------
	function url($filename)
	{
		window.location.href = $filename;	
	}
//------------------------------------------------------------------------------------------------------------
	function isNumber(value)
	{
		var value = value;
		if(value.length < 1) { return 0; }
		var anum=/(^\d+$)|(^\d+\.\d+$)/
	
		if(value.match(anum))
		{
			return 1;
		}
		else
		{
			return 0;
		}	
	}
	
	function Trim(strText) 
	{	
        // this will get rid of leading spaces 
        while (strText.substring(0,1) == ' ') 
            strText = strText.substring(1, strText.length);

        // this will get rid of trailing spaces 
        while (strText.substring(strText.length-1,strText.length) == ' ')
            strText = strText.substring(0, strText.length-1);

        return strText;
	} 
	
	
	function setParentLocation($id)
	{
		this.parent.location.href = $id;
	}
	
	function setIFrameFile($frame_id,$filename)
	{
		document.getElementById($frame_id).src = $filename;
	}
	
	function setIFrameFileAdmin($frame_id,$filename,$id)
	{
		if($id > 0)
			document.getElementById($frame_id).src = $filename;
	}

	function ChangeFrameLinkColor(idd)
	{
		var $table = document.getElementById("links");
		var $cell = $table.getElementsByTagName("a");
		for($i=0;$i < $cell.length;$i++)
		{
			if($cell[$i].id == idd)
				document.getElementById($cell[$i].id).className="LinkBlackBold";
			else
				document.getElementById($cell[$i].id).className="LinkBlue";
		}
	}

//------------------------------------------------------------------------------------------------------------
function getLayoutImage(obj)
{
var selval= obj.value;
if(selval=='2'){document.getElementById('colboxdiv').innerHTML='Pick 3 Special Offer:';}else
{document.getElementById('colboxdiv').innerHTML='Collector Box Sets Logo:';}


	var ajaxRequest;
	try
	{
		ajaxRequest = new XMLHttpRequest();		
	}catch (e)
	{
		//Internet Explorer Browsers
		try
		{
			ajaxRequest = new AvtiveXOject("Msxml2.XMLHTTP");	
		}catch (e)
		{
			try
			{
				ajaxRequest = new ActiveXObject("Microsoft.XMLHTTP");
			} catch (e)
			{
				// Something went wrong
				alert("Your browser broke!");
				return false;
			}	
		}
	}
	// Create a function that will receive data sent from the server
	ajaxRequest.onreadystatechange = function()
	{
		if(ajaxRequest.readyState == 4)
		{
			var get_str=ajaxRequest.responseText;	
		
			if(get_str!='--')
			{	
				gs=get_str.split("~");
				icnt=parseInt(gs[1]);
		
				tcnt=parseInt(gs[2]);
				var cont = '<img src="../display_image.php?path=upload_images/layouts/'+gs[0]+'&height=500&width=400&watermark=-1" class="img">'						
				document.getElementById('div_layout').innerHTML=cont;	
				if(icnt>0)
				{
					for(i=1;i<=icnt;i++){
						trid='tr'+i;							
						document.getElementById(trid).style.display="block";
					}
					for(i=icnt+1;i<=20;i++){
						trid1='tr'+i;	
						pimg='hidimage'+i;
						dbimg='dbhidimage'+i;
						dbdiv='divdbimage'+i;
						divid='divimage'+i;
						
						if(document.getElementById(pimg) != null ) document.getElementById(pimg).value="";
						if(document.getElementById(dbimg) != null) document.getElementById(dbimg).value="";
						if(document.getElementById(dbdiv) != null) document.getElementById(dbdiv).innerHTML="";
						if(document.getElementById(divid) != null) document.getElementById(divid).innerHTML="";
						document.getElementById(trid1).style.display="none";
						
					}
				}
				else 
				{
					for(i=1;i<=20;i++){
						trid1='tr'+i;							
						pimg='hidimage'+i;
						dbimg='dbhidimage'+i;
						dbdiv='divdbimage'+i;
						divid='divimage'+i;
						if(document.getElementById(pimg) != null ) document.getElementById(pimg).value="";
						if(document.getElementById(dbimg) != null) document.getElementById(dbimg).value="";
						if(document.getElementById(dbdiv) != null) document.getElementById(dbdiv).innerHTML="";
						if(document.getElementById(divid) != null) document.getElementById(divid).innerHTML="";
						document.getElementById(trid1).style.display="none";
					}					
				}
				
				if(tcnt>0)
				{
					for(i=1;i<=tcnt;i++){
						trtid='trt'+i;
						document.getElementById(trtid).style.display="block";					
						
					}
					for(i=tcnt+1;i<=20;i++){
						trtid1='trt'+i;
						document.getElementById(trtid1).style.display="none";	
						descr='description'+i;
						if(document.getElementById(descr) != null)
						document.getElementById(descr).value="";						
					}
					
				}
				else
				{
					for(i=1;i<=20;i++){
						trtid1='trt'+i;
					    document.getElementById(trtid1).style.display="none";					
						descr='description'+i;
						if(document.getElementById(descr) != null)
						document.getElementById(descr).value="";	
					}	
				}
				if(gs[0]!="")
				document.getElementById('hid_layoutimg').value=gs[0];
				
			}else
			{
				document.getElementById('hid_layoutimg').value='';
			}
			
			
		}
	}
	
	ajaxRequest.open("GET","getlayoutimage.php?id="+selval,true);
	ajaxRequest.send(null);	
}
//------------------------------------------------------------------------------------------------------------
//------------------------------------------------------------------------------------------------------------
function removeTempImage(img,num)
{	
	var ajaxRequest;
	try
	{
		ajaxRequest = new XMLHttpRequest();		
	}catch (e)
	{
		//Internet Explorer Browsers
		try
		{
			ajaxRequest = new AvtiveXOject("Msxml2.XMLHTTP");	
		}catch (e)
		{
			try
			{
				ajaxRequest = new ActiveXObject("Microsoft.XMLHTTP");
			} catch (e)
			{
				// Something went wrong
				alert("Your browser broke!");
				return false;
			}	
		}
	}
	// Create a function that will receive data sent from the server
	ajaxRequest.onreadystatechange = function()
	{
		if(ajaxRequest.readyState == 4)
		{
			var get_str=ajaxRequest.responseText;
				var divid ='divimage'+num; 
				var hidid ='hidimage'+num; 
				document.getElementById(hidid).value='';			
				document.getElementById(divid).style.display='none';							
		}
	}
	ajaxRequest.open("GET","remtempimage.php?img="+img,true);
	ajaxRequest.send(null);	
	
}

function removeDBImage(id,num)
{	
	var ajaxRequest;
	try
	{
		ajaxRequest = new XMLHttpRequest();		
	}catch (e)
	{
		//Internet Explorer Browsers
		try
		{
			ajaxRequest = new AvtiveXOject("Msxml2.XMLHTTP");	
		}catch (e)
		{
			try
			{
				ajaxRequest = new ActiveXObject("Microsoft.XMLHTTP");
			} catch (e)
			{
				// Something went wrong
				alert("Your browser broke!");
				return false;
			}	
		}
	}
	// Create a function that will receive data sent from the server
	ajaxRequest.onreadystatechange = function()
	{
		if(ajaxRequest.readyState == 4)
		{
				var get_str=ajaxRequest.responseText;
				divid ='divdbimage'+num; 
				document.getElementById(divid).style.display="none";	
				hidid ='dbhidimage'+num; 
				if(document.getElementById(hidid).value!='')
					document.getElementById(hidid).value='';
				
		}
	}
	
	ajaxRequest.open("GET","remdbimage.php?id="+id+"&num="+num,true);
	ajaxRequest.send(null);	
	
}

//------------------------------------------------------------------------------------------------------------

//following function performed for clearing search box

function clearSearch(obj)
{
	obj.value="";
}	

function showOver(obj,url){
	
	document.getElementById(obj).src = url+"images/"+obj+"_over.jpg";
}

function showOrign(obj,url)
{
	document.getElementById(obj).src = url+"images/"+obj+".jpg";
}