var SiteURL = 'http://Calligraphy-experts.com/';
var IsIEUsed = true;
var browserName=navigator.appName;				
if (browserName!="Microsoft Internet Explorer")
{
	IsIEUsed = false;
}
function ConfirmDelete(Message)
{
	return confirm(Message);
}

function ConfirmDelAll(Message,chkid)
{
	var chk = document.getElementById(chkid);
	if (chk!=null)
	{
		if (chk.checked==true)
			return confirm(Message);
		else
			return false;
	}
	else
		{
			return false;
		}
}

function ConfirmActDeAct(Message)
{
	return confirm(Message);
}

function HideShow(objName,objHideName)
{
	var obj=document.getElementById(objName);	
	if (obj!=null)
	{
		if(obj.style.display == "inline")
		{
			obj.style.display = "none";
		}
		else if(obj.style.display == "none")
			obj.style.display = "inline";
	}	
	var objHide=document.getElementById(objHideName);
	if (objHide!=null)
	{
		objHide.style.display = "none";
	}
		
}

function HideUnhide(objName,objName1,objName2)
{
	var obj=document.getElementById(objName);
	var obj1=document.getElementById(objName1);
	var obj2=document.getElementById(objName2);

	if(obj.style.display == "inline")
	{
		obj.style.display = "none";
		obj1.style.display = "none";
		obj2.style.display = "none";
	}
	
	else if(obj.style.display == "none")
	{
		obj.style.display = "inline";
		obj1.style.display = "inline";
		obj2.style.display = "inline";
	}
	
}

function mypopup(filepath)
{
	var u = SiteURL + 'ViewSample.aspx?fname=' + filepath;	
  mywindow = window.open(u,"mywindow","location=0,status=1,scrollbars=0,width=700,height=600,menubar=0,toolbar =0,status=0,resizable=1,top=100,left=200");
  //mywindow = window.open('localhost',"mywindow","location=0,status=1,scrollbars=0,width=700,height=600,menubar=0,toolbar =0,status=0,resizable=1,top=100,left=200");
} 

function mylayout(filepath)
{
  var winl = (screen.width-385)/2;
  var wint = (screen.height-450)/2;
  //mywindow = window.open('http://localhost/calligraphy/ViewLayout.aspx?fname=' + filepath,"mywindow","location=0,status=1,scrollbars=0,width=385,height=450,menubar=0,status=0,toolbar =0,resizable=1,top=" + wint + ",left=" + winl);
  mywindow = window.open(SiteURL+'ViewLayout.aspx?fname=' + filepath,"mywindow","location=0,status=1,scrollbars=0,width=385,height=450,menubar=0,status=0,toolbar =0,resizable=1,top=" + wint + ",left=" + winl);  
} 

function myAnnouncement(filepath)
{
	if (filepath=='')
		return
		
	width1=700;
	height1=600;
	
	var winl = (parseInt(screen.width-width1) + 20)/2;
	var wint = (parseInt(screen.height-height1) + 20)/2;
	
	width1= parseInt(width1)-20;
	height1= parseInt(height1)-20;
	
	
	//mywindow = window.open('http://localhost/calligraphy/ViewLayout.aspx?fname=' + filepath,"mywindow","location=0,status=1,scrollbars=0,width=" + width1 + ",height=" + height1 + ",menubar=0,status=0,toolbar =0,resizable=1,top=" + wint + ",left=" + winl);
	mywindow = window.open(SiteURL+'ViewLayout.aspx?fname=' + filepath,"mywindow","location=0,status=1,scrollbars=0,width=" + width1 + ",height=" + height1 + ",menubar=0,status=0,toolbar =0,resizable=1,top=" + wint + ",left=" + winl);    
 }

function myAnnouncement_Bigger(filepath)
{
	if (filepath=='')
		return
		
	width1=700;
	height1=600;
	
	var winl = (parseInt(screen.width-width1) + 20)/2;
	var wint = (parseInt(screen.height-height1) + 20)/2;
	
	width1= parseInt(width1)-20;
	height1= parseInt(height1)-20;
	
	
	//mywindow = window.open('http://localhost/calligraphy/ViewLayout.aspx?fname=' + filepath,"mywindow","location=0,status=1,scrollbars=1,width=" + width1 + ",height=" + height1 + ",menubar=0,status=0,toolbar =0,resizable=1,top=" + wint + ",left=" + winl);
	mywindow = window.open(SiteURL+'ViewLayout.aspx?fname=' + filepath,"mywindow","location=0,status=1,scrollbars=1,width=" + width1 + ",height=" + height1 + ",menubar=0,status=0,toolbar =0,resizable=1,top=" + wint + ",left=" + winl);    
 }


function CloseWindow()
{
	self.close();
	
}

function replaceCharacters(conversionString,inChar,outChar)
{
  var convertedString = conversionString.split(inChar);
  convertedString = convertedString.join(outChar);
  return convertedString;
}
function SetFocus(controlId)
{
 var control = document.getElementById(controlId);					
 control.focus();
}
