﻿//********************************
//********************************

function printTabsContent(dirValue,cssLink,faqIndex,isStructure) {

		//alert("/"+cssLink.split('/')[1]+"/"+cssLink.split('/')[2]+"/"+"Header-temp.png");

//var printableeee= document.getElementById("flowpanes");
		if (faqIndex != undefined)
        {
              	//	var printableeee= document.getElementById("Printable"+faqIndex);
              		
              		var printableeee= document.getElementById("tabContent"+faqIndex);
}
      		
        var pageHeader = $('.Newtitle table tr td')[0].innerHTML;
		var printLink='طباعة';
		var closeLink='إغلاق';
		if (dirValue == 'rtl'){
		printLink='طباعة';
		closeLink='إغلاق';

		}
		else if (dirValue == 'ltr'){
		printLink='Print';
		closeLink='Close';
		}
		var printCloseTable="<div style='background-color:white;height:30px' align='center' id='printCloseTableee' width='100%'><a id='printThis' href='#' onclick='printThisPage();'><strong>"+printLink+"</strong></a> -- <a href='#' id='closethisWindow' onclick='window.close();'><strong>"+closeLink+"</strong></a></div>";
       

		var WindowObject = window.open('', "TrackHistoryData", "width=700px,height=600px,toolbars=no,scrollbars=1,status=no,resizable=no");
		var hideImageScript ="  <script>  try{  var inputs = document.getElementsByTagName('input') ; for ( var x=0 ; x < inputs.length ; x++){if (inputs[x].type=='image'){ inputs[x].style.display='none';} else if (inputs[x].type=='checkbox'){ inputs[x].parentNode.style.display='none';} }} catch(rererewwww){} try{document.getElementById('HiDeMe_Pager').style.display='none'; } catch(nnnmm){} try{document.getElementById('HiDeMe').style.display='none';} catch(yyuyuy){} try{var tables= document.getElementsByTagName('table'); for (var x = 0 ; x < tables.length ; x++){ tables[0].style.width='588px';  if ("+isStructure+") continue; tables[x].dir='"+dirValue+"' ;  tables[x].style.width='588px';} } catch(wwwww){} try{ var selects= document.getElementsByTagName('select'); for (var x = 0 ; x < selects.length ; x++) selects[x].disabled='disabled'; } catch(vvvvvvv){} try{ var anchors= document.getElementsByTagName('a'); for (var x = 0 ; x < anchors.length ; x++){ if (anchors[x].id=='printThis' || anchors[x].id=='closethisWindow' ){continue;}anchors[x].onclick='return false;'; anchors[x].removeAttribute('href');} } catch(yyyy){} try{document.getElementById('ctl00_PlaceHolderMain_ViewProjects1_projectsGridView').style.direction='"+dirValue+"'}catch(zxc){} try{document.getElementById('chart_div').style.overflow='hidden';document.getElementById('chart_div').style.width='100%'}catch(zxc){}try{document.getElementById('_printButton').style.display='none';document.getElementById('_CommentsTable').style.display='none';}catch(tttt){}; try{document.getElementById('ctl00_PlaceHolderMain_ViewPublicationDetails_UC1__publicationDetailsGridView_ctl02__downloadBookLinkButton').style.display='none';}catch(ytyt){}; function printThisPage(){document.getElementById('printCloseTableee').style.display='none';print();close();}</script>";
		
		WindowObject.document.write("<link href='"+cssLink+"' rel='stylesheet' type='text/css' />");	
			
        WindowObject.document.write("<center><table dir='"+dirValue+"'>"+printCloseTable+" <div style'width:100%' align='center' ><img src='"+"/"+cssLink.split('/')[1]+"/"+cssLink.split('/')[2]+"/"+"Header-temp.png"+"'/> </div> <div style'width:100%' align='center' > <h3>"+pageHeader+"</h3>  </div> "+printableeee.innerHTML  +hideImageScript+"</table></center> <br/><br/>  <script>try{  document.getElementById('chart_div').style.overflow='auto'; } catch(sds){} </script>");
    
    	WindowObject.document.close();
        WindowObject.focus();

       // WindowObject.print();
       // WindowObject.close();
    }



//************************************
//************************************


function printContent(dirValue,cssLink,faqIndex,isStructure) {

		//alert("/"+cssLink.split('/')[1]+"/"+cssLink.split('/')[2]+"/"+"Header-temp.png");

var printableeee;
		if (faqIndex == undefined)
        	printableeee = document.getElementById("Printable");
      	else
      		printableeee = document.getElementById("Printable"+faqIndex);
      		
        var pageHeader = $('.Newtitle table tr td')[0].innerHTML;
		var printLink='طباعة';
		var closeLink='إغلاق';
		if (dirValue == 'rtl'){
		printLink='طباعة';
		closeLink='إغلاق';

		}
		else if (dirValue == 'ltr'){
		printLink='Print';
		closeLink='Close';
		}
		var printCloseTable="<div style='background-color:white;height:30px' align='center' id='printCloseTableee' width='100%'><a id='printThis' href='#' onclick='printThisPage();'><strong>"+printLink+"</strong></a> -- <a href='#' id='closethisWindow' onclick='window.close();'><strong>"+closeLink+"</strong></a></div>";
       

		var WindowObject = window.open('', "TrackHistoryData", "width=700px,height=600px,toolbars=no,scrollbars=1,status=no,resizable=no");
		var hideImageScript ="  <script>  try{  var inputs = document.getElementsByTagName('input') ; for ( var x=0 ; x < inputs.length ; x++){if (inputs[x].type=='image'){ inputs[x].style.display='none';} else if (inputs[x].type=='checkbox'){ inputs[x].parentNode.style.display='none';} }} catch(rererewwww){} try{document.getElementById('HiDeMe_Pager').style.display='none'; } catch(nnnmm){} try{document.getElementById('HiDeMe').style.display='none';} catch(yyuyuy){} try{var tables= document.getElementsByTagName('table'); for (var x = 0 ; x < tables.length ; x++){ tables[0].style.width='588px';  if ("+isStructure+") continue; tables[x].dir='"+dirValue+"' ;  tables[x].style.width='588px';} } catch(wwwww){} try{ var selects= document.getElementsByTagName('select'); for (var x = 0 ; x < selects.length ; x++) selects[x].disabled='disabled'; } catch(vvvvvvv){} try{ var anchors= document.getElementsByTagName('a'); for (var x = 0 ; x < anchors.length ; x++){ if (anchors[x].id=='printThis' || anchors[x].id=='closethisWindow' ){continue;}anchors[x].onclick='return false;'; anchors[x].removeAttribute('href');} } catch(yyyy){} try{document.getElementById('ctl00_PlaceHolderMain_ViewProjects1_projectsGridView').style.direction='"+dirValue+"'}catch(zxc){} try{document.getElementById('chart_div').style.overflow='hidden';document.getElementById('chart_div').style.width='100%'}catch(zxc){}try{document.getElementById('_printButton').style.display='none';document.getElementById('_CommentsTable').style.display='none';}catch(tttt){}; try{document.getElementById('ctl00_PlaceHolderMain_ViewPublicationDetails_UC1__publicationDetailsGridView_ctl02__downloadBookLinkButton').style.display='none';}catch(ytyt){}; function printThisPage(){document.getElementById('printCloseTableee').style.display='none';print();close();}</script>";
		
		WindowObject.document.write("<link href='"+cssLink+"' rel='stylesheet' type='text/css' />");	
			
        WindowObject.document.write("<center><table dir='"+dirValue+"'>"+printCloseTable+" <div style'width:100%' align='center' ><img src='"+"/"+cssLink.split('/')[1]+"/"+cssLink.split('/')[2]+"/"+"Header-temp.png"+"'/> </div> <div style'width:100%' align='center' > <h3>"+pageHeader+"</h3>  </div> "+printableeee.innerHTML+hideImageScript+"</table></center> <br/><br/>  <script>try{  document.getElementById('chart_div').style.overflow='auto'; } catch(sds){} </script>");
    
    	WindowObject.document.close();
        WindowObject.focus();

       // WindowObject.print();
       // WindowObject.close();
    }

function printContentPast(elementToPrint,dirValue,cssLink) {

      var printableeee = document.getElementById(elementToPrint);


	var printLink='طباعة';
		var closeLink='إغلاق';
		if (dirValue == 'rtl'){
		printLink='طباعة';
		closeLink='إغلاق';

		}
		else if (dirValue == 'ltr'){
		printLink='Print';
		closeLink='Close';
		}


		var printCloseTable="<div style='background-color:white;height:30px' align='center' id='printCloseTableee' width='100%'><a id='printThis' href='#' onclick='printThisPage();'><strong>"+printLink+"</strong></a> -- <a href='#' onclick='window.close();'><strong>"+closeLink+"</strong></a></div>";
        if (dirValue == 'rtl'){
        var WindowObject = window.open('', "طباعة", "width=700px,height=600px,toolbars=no,scrollbars=1,status=no,resizable=no");
        }
        else{
         var WindowObject = window.open('', "Print", "width=700px,height=600px,toolbars=no,scrollbars=1,status=no,resizable=no");
        }
		var hideImageScript ="<script src='/js/jquery-1.4.2.min.js' type='text/javascript'></script> <script>try{document.getElementById('_printButton').style.display='none'}catch(tttt){}; function printThisPage(){document.getElementById('printCloseTableee').style.display='none';print();close();}</script>";
		
		WindowObject.document.write("<link href='"+cssLink+"' rel='stylesheet' type='text/css' />");
				
        WindowObject.document.write("<table dir='"+dirValue+"'>"+printCloseTable+printableeee.innerHTML+hideImageScript+"</table>");
	    
        WindowObject.document.close();
        WindowObject.focus();
        //WindowObject.print();
       // WindowObject.close();

}



function printFAQ(dirValue,titleee,cssLink) {

      var printableeee = document.getElementById('gridViewContainer');


	var printLink='طباعة';
		var closeLink='إغلاق';
		if (dirValue == 'rtl'){
		printLink='طباعة';
		closeLink='إغلاق';

		}
		else if (dirValue == 'ltr'){
		printLink='Print';
		closeLink='Close';
		}


		var printCloseTable="<div style='background-color:white;height:30px' align='center' id='printCloseTableee' width='100%'><a id='printThis' href='#' onclick='printThisPage();'><strong>"+printLink+"</strong></a> -- <a href='#' onclick='window.close();'><strong>"+closeLink+"</strong></a></div>";
        var WindowObject = window.open('', "TrackHistoryData", "width=700px,height=600px,scrollbars=1,toolbars=no,status=no,resizable=no");
		var hideImageScript =" <script> document.getElementById('FAQ_HEADER').innerHTML='<center>"+titleee+"</center>'; try{document.getElementById('suggestLink').style.display='none';document.getElementById('_printButton').style.display='none';}catch(tttt){}; function printThisPage(){document.getElementById('printCloseTableee').style.display='none';print();close();}</script>";
		
		WindowObject.document.write("<link href='"+cssLink+"' rel='stylesheet' type='text/css' />");
			
        WindowObject.document.write("<table width='100%' dir='"+dirValue+"'> <tr> <td style='width:100%'>"+printCloseTable+printableeee.innerHTML+hideImageScript+"</td></tr></table>");
        WindowObject.document.close();
        WindowObject.focus();
        //WindowObject.print();
       // WindowObject.close();

}


$(document).ready(function(){
try
{
   if (document.body.dir == 'rtl')     
document.getElementById("_printButton").title = "Print";
else
document.getElementById("_printButton").title = "طباعة";
}
catch(ex){}
       });
