﻿// JScript File
var fontVariation=2;
var minFontSize=11;
var maxFontSize=13;

function enlargeFont(bigger)
{
var elements=document.getElementById("mycustomscroll");

var tds=elements.getElementsByTagName("TD");
//alert(m);
	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 ValidateSearch()
{
var msg;
var msg2;
msg2="Please enter the following information:\n" 
if (document.getElementById('controlSearch1_txtSearch').value==""){
    msg = "- Search Value \n"
alert(msg2 + msg);}
return true;
}
function ValidateSearchGermen()
{
var msg;
var msg2;
msg2="Please enter the following information:\n" 
if (document.getElementById('controlSearch_txtSearch').value==""){
    msg = "- Search Value \n"
alert(msg2 + msg);}
return true;
}
function ValidateForm()
{
         var msg;
         var msg2;
	      msg=""
	   msg2="";
       if (document.getElementById('txtName').value=="")
           msg +="-  Name\n" 
	   if (document.getElementById('txtComments').value=="")
		   msg +="- Comments\n" 
	   if (document.getElementById('txtEmail').value=="")
		   msg +="- Email\n" 
		      else{
		            if (IsValidEmailAddress(document.getElementById('txtEmail'))==false)
	               msg2="- Invalid email address \n"}
	            if (msg!="")
	            {
	               msg="Please enter the following information:\n" + msg +msg2
		            alert(msg);
		            return false;
	            }
	            else{
	               if (msg2==""){
	               return true;
	               }else{
	                alert(msg2);
		            return false;}
		            }
	} 
	function IsValidEmailAddress(txt){
	if(txt.value !=""){ 
		var goodEmail = txt.value.match(/\b(^(\S+@).+((\.com)|(\.net)|(\.edu)|(\.mil)|(\.gov)|(\.org)|(\..{2,2}))$)\b/gi);
		if (goodEmail){
			return true;
		} else {
			return false;
		}
	}
}
function SubmitLoginTop5()
		 {
        // 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("controlSearch1_imgSearch").click();
        }
    }
 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("mycustomscroll").innerHTML;
	var title_vlue = document.getElementById("title").innerHTML;
	var subtitle_vlue=document.getElementById("subtitle").innerHTML;

	var docprint=window.open("","",disp_setting);
/*font-family:Arial, Helvetica, sans-serif;font-weight:normal;letter-spacing:normal;background:#ffffff;font-size:10px;color:#6d6e71;*/
	docprint.document.open();
	docprint.document.write('<html><head><title> O I B </title><style> a{color:#000; text-decoration:none;}</style>');
	docprint.document.write('<link href="../css/styles.css" type="text/css" rel="stylesheet" media="screen" /></head><body onLoad="self.print(); self.close();" style="font-size:13px;" >');
	docprint.document.write('<div><table width="100%" border="0" cellspacing="0" cellpadding="0"><tr><td valign="top" style="background:#ffffff;">&nbsp;</td><td valign="top" style="background:#ffffff;">&nbsp;</td></tr><tr><td width="242" valign="top"><img src="../images/oib-logo-body.gif" width="242" height="89" border="0"/></td><td valign="top" style="background:#ffffff;">&nbsp;</td></tr></table></div>');
	docprint.document.write('<div><table style="background:#ffffff;" class="sub-title-body" width="100%" border="0" cellspacing="0" cellpadding="0"><tr><td valign="top">&nbsp;</td><td valign="top">&nbsp;</td></tr><tr><td style="padding-left:30px;" valign="top">'+title_vlue+'</td><td valign="top" style="background:#ffffff;">&nbsp;</td></tr></table></div>');
	docprint.document.write('<div><table style="background:#ffffff;" class="sub-title-body" style="color:#000000;font-size:11px;" width="100%" border="0" cellspacing="0" cellpadding="0"><tr><td style="padding-left:30px;" valign="top">'+subtitle_vlue+'</td><td valign="top" style="background:#ffffff;">&nbsp;</td></tr></table></div>');
	docprint.document.write('<div style="margin:0;padding:0;padding-left:30px;background:#ffffff;">'+'<br><br>'+content_vlue+'</div>');
	docprint.document.write('</body></html>');
	docprint.document.close(); 
 	docprint.focus();
}
function Popalbummail(){
    window.open('forwardtoafriend.aspx','','left=100,top=50,width=800,height=500,toolbar=0,scrollbars=1,status=0,resizeable=1');
}
