// JavaScript Document
function ValidateSearch()
		{	
			var msg="";
			if ((document.getElementById('ControlHeader1_txtSearch').value==""))
				msg +="- keyword\n" 
			if (msg!="")
			{
				msg="Please enter the following information:\n" + msg
				alert(msg);
				return false;
			}
			else
				return true; 
		}
		

function MM_swapImgRestore() { //v3.0
  var i,x,a=document.MM_sr; for(i=0;a&&i<a.length&&(x=a[i])&&x.oSrc;i++) x.src=x.oSrc;
}

function MM_preloadImages() { //v3.0
  var d=document; if(d.images){ if(!d.MM_p) d.MM_p=new Array();
    var i,j=d.MM_p.length,a=MM_preloadImages.arguments; for(i=0; i<a.length; i++)
    if (a[i].indexOf("#")!=0){ d.MM_p[j]=new Image; d.MM_p[j++].src=a[i];}}
}

function MM_findObj(n, d) { //v4.01
  var p,i,x;  if(!d) d=document; if((p=n.indexOf("?"))>0&&parent.frames.length) {
    d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);}
  if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i<d.forms.length;i++) x=d.forms[i][n];
  for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=MM_findObj(n,d.layers[i].document);
  if(!x && d.getElementById) x=d.getElementById(n); return x;
}

function MM_swapImage() { //v3.0
  var i,j=0,x,a=MM_swapImage.arguments; document.MM_sr=new Array; for(i=0;i<(a.length-2);i+=3)
   if ((x=MM_findObj(a[i]))!=null){document.MM_sr[j++]=x; if(!x.oSrc) x.oSrc=x.src; x.src=a[i+2];}
}

function toggleBlockPlus(d, i)
{
	var e = MM_findObj(d);
	var f = MM_findObj(i);
	
	if (!e) return;
	if (e.style.display == "none"){
		e.style.display = "block";
		f.className = 'toggle-minus';
	} else { 
		e.style.display = "none";
		f.className = 'toggle-plus';
	}
}
function SubmitSearchonclick()
		 {
        // process only the Enter key
        if (event.keyCode == 13)
        {
            // cancel the default submit
            event.returnValue=false;
            event.cancel = true;
            // submit the form by programmatically clicking the specified button
            document.getElementById("ControlHeader1_imgSearch").click();
        }
    }
    
    var fontVariation=2;
var minFontSize=11;
var maxFontSize=13;
    
    function enlargeFont(bigger)
{
	var elements=document.getElementById("DIV1");
	var tds=elements.getElementsByTagName("TD");
	var newFontSize="";
		newFontSize=elements.style.fontSize;
		if(newFontSize=="")
			newFontSize=minFontSize;
			newFontSize=parseInt(newFontSize);
		if(bigger){
			newFontSize=(newFontSize<maxFontSize)?(newFontSize+fontVariation):(maxFontSize);}
		else
			{newFontSize=(newFontSize>minFontSize)?(newFontSize-fontVariation):(newFontSize);}
		
	elements.style.fontSize=newFontSize+'px';
	
	for(var i=0;i<tds.length; i++){
		tds[i].style.fontSize=newFontSize+'px';
	}
}
function print_function()
{ 
	var disp_setting="toolbar=no,location=no,directories=no,menubar=no,";
		disp_setting+="scrollbars=yes,width=600, height=500, left=100, top=100";
	var content_vlue = document.getElementById("DIV1").innerHTML;
	var title_page=document.getElementById("ControlHeader1_lblpagename").innerHTML;
	
	// finding the initial flash vars
	var mainTag = document.getElementById("DIV1");
	var param_elems = mainTag.getElementsByTagName("PARAM")
	for (var i=0; i < param_elems.length; i++) {
		if(param_elems[i].name.toLowerCase() == "flashvars"){
			var flashvars_value = param_elems[i].value;
			break;
		}
	};
	
	// remove script tag
	while(content_vlue.indexOf("<script") != -1 || content_vlue.indexOf("<SCRIPT") != -1){
		var ind = content_vlue.indexOf("<script");
		if(ind == -1) ind = content_vlue.indexOf("<SCRIPT")
		var ind2 = content_vlue.indexOf("</script>");
		if(ind2 == -1) ind2 = content_vlue.indexOf("</SCRIPT>");
		var content_before_script = content_vlue.slice(0, ind);
		var content_after_script  = content_vlue.slice(ind2 + 9, content_vlue.length);
		content_vlue = content_before_script + content_after_script;
	}
	
	// add the flash vars value to IE object
	content_vlue = content_vlue.split('<PARAM NAME="FlashVars" VALUE="">').join('<PARAM NAME="FlashVars" VALUE="'+ flashvars_value +'">');

	var docprint=window.open("","",disp_setting);

	docprint.document.open();
	docprint.document.write('<html><head><title>FCCIAl</title>');
	docprint.document.write('<link rel="stylesheet" href="../css/styles.css">');
	docprint.document.write('</head><body onLoad="self.print(); self.close();" style="margin:0px; padding:0px 15px 15px 15px; ;background-color:#FFFFFF;background-image:none" >');
	docprint.document.write('<div style="background-color:#FFF;"><div style="background-color:#FFF;"><img src="../images/logo.gif"  style="border: 0;margin-bottom:10px;" /></div>');
	docprint.document.write('<div class="pad-div-sub"><div class="pad-content-sub"><strong><span class="colorTitle" style="font-size:16px;">'+title_page+'</span></strong><br><br><br>'+content_vlue+'</div></div>');
	docprint.document.write('</div></body></html>');
	docprint.document.close(); 
 	docprint.focus();
}


function print_functiongridview()
{ 
	var disp_setting="toolbar=no,location=no,directories=no,menubar=no,";
		disp_setting+="scrollbars=yes,width=600, height=500, left=100, top=100";
	var content_vlue = document.getElementById("div11").innerHTML;
	var content_vlue1=document.getElementById("divsearchresult").innerHTML;
	// finding the initial flash vars
	var mainTag = document.getElementById("div11");
	var param_elems = mainTag.getElementsByTagName("PARAM")
	for (var i=0; i < param_elems.length; i++) {
		if(param_elems[i].name.toLowerCase() == "flashvars"){
			var flashvars_value = param_elems[i].value;
			break;
		}
	};
	
	// remove script tag
	while(content_vlue.indexOf("<script") != -1 || content_vlue.indexOf("<SCRIPT") != -1){
		var ind = content_vlue.indexOf("<script");
		if(ind == -1) ind = content_vlue.indexOf("<SCRIPT")
		var ind2 = content_vlue.indexOf("</script>");
		if(ind2 == -1) ind2 = content_vlue.indexOf("</SCRIPT>");
		var content_before_script = content_vlue.slice(0, ind);
		var content_after_script  = content_vlue.slice(ind2 + 9, content_vlue.length);
		content_vlue = content_before_script + content_after_script;
	}
	
	// add the flash vars value to IE object
	content_vlue = content_vlue.split('<PARAM NAME="FlashVars" VALUE="">').join('<PARAM NAME="FlashVars" VALUE="'+ flashvars_value +'">');

	var docprint=window.open("","",disp_setting);

	docprint.document.open();
	docprint.document.write('<html><head><title>FCCIAl</title>');
	docprint.document.write('<link rel="stylesheet" href="../css/styles.css">');
	docprint.document.write('</head><body onLoad="self.print(); self.close();" style="margin:0px; padding:0px 15px 15px 15px; background-color:#FFFFFF;background-image:none">');
	docprint.document.write('<div style="background-color:#FFF;"><div style="background-color:#FFF;"><img src="../images/logo.gif"  style="border: 0;margin-bottom:10px;" /></div>');
	docprint.document.write('<div style="margin:10px 0;background-color:#FFF;padding-left:10px;">'+ content_vlue1 +'</div>');
	docprint.document.write('<div style="background-color:#FFF;" class="pad-div-sub"><div style="background-color:#FFF;" class="pad-content-sub">'+content_vlue+'</div></div>');
	docprint.document.write('</div></body></html>');
	docprint.document.close(); 
 	docprint.focus();
}

function print_functionforpopup()
{ 
	var disp_setting="toolbar=no,location=no,directories=no,menubar=no,";
		disp_setting+="scrollbars=yes,width=775, height=600, left=100, top=100";
	var content_vlue = document.getElementById("div1").innerHTML;
	/*var title_vlue = document.getElementById("Title").innerHTML;*/
    var title_vlue =""
	var docprint=window.open("","",disp_setting);

	docprint.document.open();
	docprint.document.write('<html><head><title> FCCIAL</title>');
	docprint.document.write('<link href="../css/styles.css" type="text/css" rel="stylesheet" media="screen" /></head><body onLoad="self.print(); self.close();" style="margin:0px;background-color:#FFFFFF;background-image:none" >');
	docprint.document.write('<div style="background-color:#FFF;"><div style="background-color:#FFF;"><img src="../images/logo.gif"  style="border: 0;margin-bottom:10px;" /></div>');
	docprint.document.write('<div style="margin:10px 0;background-color:#FFF;padding-left:10px;">'+ title_vlue +'</div>');
	docprint.document.write('<div style="background-color:#FFF;" class="pad-div-sub"><div style="background-color:#FFF;" class="pad-content-sub">'+content_vlue+'</div></div>');
	docprint.document.write('</div></body></html>');
	docprint.document.close(); 
 	docprint.focus();
}


function Popalbum(){
    window.open('Popupalbum.aspx','','left=100,top=50,width=500,height=500,toolbar=0,scrollbars=1,status=0,resizeable=1');
}
function PopalbumlocalForm(){
    window.open('printLocalmarketsearchresults.aspx','','left=100,top=50,width=710,height=500,toolbar=0,scrollbars=1,status=0,resizeable=1');
}
function PopalbumExportForm(){
    window.open('PrintExportMarketSearchReasults.aspx','','left=100,top=50,width=750,height=500,toolbar=0,scrollbars=1,status=0,resizeable=1');
}
function PopalbumInternationalForm(){
    window.open('printInternationalfairssearchresults.aspx','','left=100,top=50,width=760,height=500,toolbar=0,scrollbars=1,status=0,resizeable=1');
}
function PopalbumlocalFormexcel(){
    window.open('printLocalmarketsearchresults.aspx?excel=export','','left=100,top=50,width=710,height=500,toolbar=0,scrollbars=1,status=0,resizeable=1');
}
function PopalbumExportFormexcel(){
    window.open('PrintExportMarketSearchReasults.aspx?excel=export','','left=100,top=50,width=750,height=500,toolbar=0,scrollbars=1,status=0,resizeable=1');
}
function PopalbumInternationalFormexcel(){
    window.open('printInternationalfairssearchresults.aspx?excel=export','','left=100,top=50,width=760,height=500,toolbar=0,scrollbars=1,status=0,resizeable=1');
}


function Swap(what,yes){
	var tds=what;
	if(yes){
	tds.className='rollover';
	}
	else{
	tds.className='';
	}
	}
