var clear_msg_var = -1;
function showHideCode(divid)
{	
	if(document.getElementById(divid).style.display == '')	
		document.getElementById(divid).style.display="none";
	else
	{	
		document.getElementById(divid).style.display="";
		document.getElementById(divid).focus();
		
	}
	
	return false;
}

function changeImgCode(imgId,flg)
{
	imgCodeLi = eval("document.getElementById('imgCodeLi"+imgId+"')");
	imgUlrLi = eval("document.getElementById('imgUlrLi"+imgId+"')");
	
	if(flg)
	{
		imgUlrLi.style.display="";
		imgCodeLi.style.display='none';
	}
	else
	{
		imgUlrLi.style.display='none';
		imgCodeLi.style.display="";
	}	
}

function changeMsg(num){

  if(clear_msg_var == -1){
	  if(navigator.appName == "Microsoft Internet Explorer"){  
      auto_copy_IE(num);
    }
    else{
    	
      //pop-up a little message that tells the user to copy the text-area.
      document.getElementById('paste_msg' + num).innerHTML = "<span style=\"color:red\">CTRL C To Copy; CTRL V To Paste</span><br/>";
    }
    clear_msg_var = num;
    return;
  }
  else{
	  
    clear_msg(num);
    if(navigator.appName == "Microsoft Internet Explorer"){
      auto_copy_IE(num);
    }
    else{
      //pop-up a little message that tells the user to copy the text-area.
      document.getElementById('paste_msg' + num).innerHTML = "<span style=\"color:red\">CTRL C To Copy; CTRL V To Paste</span><br/>";
    }
    clear_msg_var = num;
  }//end else
  //window.setTimeout("clear_msg(" + num + ")", 5000);
}//end function say_alert

//clear message
function clear_msg(num){
 
  var browser_type='IE';
  if (navigator.appName=="Netscape") 
  	browser_type = "FF";
  else 
    browser_type = "IE";
  
  if(browser_type == "IE"){
    document.getElementById('paste_msg' + num).innerHTML = "&nbsp;";
  }
  else{
    document.getElementById('paste_msg' + num).innerHTML = "Click The Text Area to Highlight The Code";
  }
  clear_msg_var = -1;
}

function auto_copy_IE(num){
  
  if(eval("document.getElementById('rdImgCode"+num+"').checked"))
  {
  	tempval = eval("document.getElementById('imgCode"+num+"')");
  	
  }
  else
  	tempval = eval("document.getElementById('imgUrl"+num+"')");
  
  tempval.focus();
  tempval.select();
  therange=tempval.createTextRange();
  therange.execCommand("Copy");
  document.getElementById('paste_msg' + num).innerHTML = "<span style=\"color:red\">(The Code Is Auto-Copied. Use CTRL + V To Paste It.)</span><br/>";
}//end of function auto_copy_IE

function getSorting(objFrm)
{	
	objFrm.submit();
}