


/* Functions merged from SurveyBuilder */


var win = null;


function CloseWindow()
{
	if (win != null)
		win.close(); // if (!win.closed) { win.close(); }

	return false;
}

/* ask user for confirmation to delete */
function CanDelete(strMsg) 
{
	return confirm(strMsg);
}

function ConfirmDelete() 
{
	if( confirm('Do you really wish to delete?') ) return; else return false;
}

function ConfirmCMSDelete() 
{
	if (confirm('Deletion will immediately affect the live site. Do you really wish to delete?')){DisableAllButton(); return ;}else{return false;}
}

function ConfirmShadowDelete() 
{
	if( confirm('This is will only delete the draft copy. Do you really wish to delete?') ) return; else return false;
}

function ConfirmUnapproveDelete() 
{
	if( confirm('This is will send this content for deletion approval. Do you really wish to continue?') ) return; else return false;
}

function ConfirmUnapprovedDelete() 
{
	if( confirm('This is will only delete the unapproved copy. Do you really wish to delete?') ) return; else return false;
}

function ConfirmShadowNewSaveApply() 
{
	if( confirm('Do you really wish to save? A draft copy will be created. If no changes has been made click back instead.') ) 
	{
		DisableAllButton();
		return;
	}
	else
	{
		return false;
	} 
}


function ConfirmShadowNewPriority() 
{
	if( confirm('Do you really wish to save? A draft copy will be created. If no changes has been made click cancel instead.') ) 
	{
		DisableAllButton();
		return;
	}
	else
	{
		return false;
	} 
}


function ConfirmShadowNewSaveApplyWithUploadAdd() 
{
	if( confirm('Do you really wish to add? If sucessfull a draft copy of the content will be created and file added. If no changes has been made click back instead.') ) 
	{
		DisableAllButton();
		return;
	}
	else
	{
		return false;
	} 
}

function ConfirmLiveSaveApply() 
{
	if( confirm('Any changes will be made immediately to the live site. Do you really wish to continue?') ) 
	{
		DisableAllButton();
		return;
	}
	else
	{
		return false;
	} 
}


function ConfirmBackToDraft() 
{
	if( confirm('Content will be set back to draft. Email will be sent to creator for action. Do you wish to continue?') ) 
	{
		DisableAllButton();
		return;
	}
	else
	{
		return false;
	} 
}


function ConfirmDraftSaveApply() 
{
	if( confirm('Any changes will be made only to the draft/unapproved copy. Do you really wish to continue?') ) 
	{
		DisableAllButton();
		return;
	}
	else
	{
		return false;
	} 
}


function ConfirmShadowSaveApply() 
{
	if( confirm('Any changes will be made to the draft copy. Do you wish to continue?') ) 
	{
		DisableAllButton();
		return;
	}
	else
	{
		return false;
	} 
}

function SendForApproval() 
{
	if( confirm('Once content is sent for approval no changes can be made by you. Do you really wish to send for approval?')){
		DisableAllButton();
		return;
	}else{
		return false;
	}
}


function ConfirmApprove() 
{
	if( confirm('Content will be set to live. Do you really wish to approve?')){
		DisableAllButton();
		return;
	}else{
		return false;
	}
}

function RoleCheck() 
{
	if(document.getElementById("RadioPrivate")!= null && document.getElementById("RadioPrivate").checked)
		showRoles();
	else
		hideRoles();
}

function SelectObject(obj)
{
	if(obj != null)
	{
		obj.focus();
		obj.select();
	}
}

function SiteOverview_OpenClose(tblObj,imgObj)
{
	toggle(tblObj.id,imgObj.id);
}

function SiteOverview_OpenAll()
{
	var _ImgPlus = "../Display/Images/minus.gif";
	elements = document.getElementsByTagName("TR");
	for (var i=0;i<elements.length;i++)
	{
		if (elements[i].id.indexOf("SiteOverview1_tblSO")>-1)
		{
			ele = document.getElementById(elements[i].id.replace("tblSO","imgSO"));
			//toggleAct(elements[i].id,ele.id,"OPEN");
			elements[i].style.display="inline";
			ele.src = _ImgPlus;
		}
	}
}

function SiteOverview_CloseAll()
{
	var _ImgMinus = "../Display/Images/plus.gif";
	elements = document.getElementsByTagName("TR");
	for (var i=0;i<elements.length;i++)
	{
		if (elements[i].id.indexOf("SiteOverview1_tblSO")>-1)
		{
			ele = document.getElementById(elements[i].id.replace("tblSO","imgSO"));
			//toggleAct(elements[i].id,ele.id,"CLOSE");
			elements[i].style.display="none";
			ele.src = _ImgMinus;
		}
	}
}

function SiteOverview_Init()
{
	elements = document.getElementsByTagName("TR");
	for (var i=0;i<elements.length;i++)
	{
		if (elements[i].id.indexOf("SiteOverview1_tblSO")>-1)
		{
		ele = document.getElementById(elements[i].id.replace("tblSO","imgSO"));
		toggleInit(elements[i].id,ele.id);
		}
	}
	
	ClearShowHideCookie();
}

function ClearShowHideCookie()
{
	DeleteCookie("FTB");
	DeleteCookie("SEO");
}

function getCookieVal (offset) {
	var endstr = document.cookie.indexOf (";", offset); 
	if (endstr == -1) 
		endstr = document.cookie.length; 
	return unescape(document.cookie.substring(offset, endstr)); 
}

function GetCookie (name) {
	var arg = name + "=";
	var alen = arg.length;
	var clen = document.cookie.length;
	var i = 0;
	while (i < clen) {
		var j = i + alen;
		if (document.cookie.substring(i, j) == arg) 
			return getCookieVal (j); 
		i = document.cookie.indexOf(" ", i) + 1;
		if (i == 0) 
			break;
	} 
	return null; 
}

function SetCookie (name, value) {
	var argv = SetCookie.arguments;
	var argc = SetCookie.arguments.length;
	var expires = (argc > 2) ? argv[2] : null; 
	var path = (argc > 3) ? argv[3] : null; 
	var domain = (argc > 4) ? argv[4] : null; 
	var secure = (argc > 5) ? argv[5] : false; 
	document.cookie = name + "=" + escape (value) + ((expires == null) ? "" : ("; expires=" + expires.toGMTString())) + ((path == null) ? "" : ("; path=" + path)) + ((domain == null) ? "" : ("; domain=" + domain)) + ((secure == true) ? "; secure" : ""); 
}

function DeleteCookie (name) {
	var exp = new Date();
	exp.setTime (exp.getTime() - 1);
	// This cookie is history
	var cval = GetCookie (name);
	document.cookie = name + "=" + cval + "; expires=" + exp.toGMTString();
}

function toggle(panelId, imgId){
var _ImgPlus = "../Display/Images/plus.gif";
var _ImgMinus = "../Display/Images/minus.gif";
	var objPanel = document.getElementById(panelId);
	var objImg = document.getElementById(imgId);
	if (objPanel.style.display!="none"){
		objPanel.style.display="none";
		SetCookie(panelId , objPanel.style.display);
		objImg.src = _ImgPlus;
	}
	else{
		objPanel.style.display="inline";
		SetCookie(panelId , objPanel.style.display);
		objImg.src = _ImgMinus;
	}
}

function toggleAct(panelId, imgId,action){
var _ImgPlus = "../Display/Images/plus.gif";
var _ImgMinus = "../Display/Images/minus.gif";
	var objPanel = document.getElementById(panelId);
	var objImg = document.getElementById(imgId);

	if(objPanel != null && objImg != null){
		if (action!="OPEN"){
			objPanel.style.display="none";
			SetCookie(panelId , objPanel.style.display);
			objImg.src = _ImgPlus;
		}
		else{
			objPanel.style.display="inline";
			SetCookie(panelId , objPanel.style.display);
			objImg.src = _ImgMinus;
		}
	}
}

function toggleInit(panelId, imgId){
var _ImgPlus = "../Display/Images/plus.gif";
var _ImgMinus = "../Display/Images/minus.gif";
	var objPanel = document.getElementById(panelId);
	var objImg = document.getElementById(imgId);
	var statePANEL = GetCookie(panelId);
	if (statePANEL)
		if (statePANEL!="") 
		{
			objPanel.style.display=statePANEL;
			if (statePANEL == "inline")
				objImg.src = _ImgMinus;
			else
				objImg.src = _ImgPlus;
		}
}

function initMenu(){
	
	var strDivId = document.getElementById("LeftMenu_strDivId").value;
    var menuId = strDivId.split(",");
    
    for (var i=0;i<menuId.length;i++){
        var obj = document.getElementById(menuId[i]);
       
        if (obj){
            var state = GetCookie(menuId[i]);
            if (!state || state=="") 
				SetCookie(menuId[i] , obj.style.display);
			else
				obj.style.display = state;
        }
    }

}

/* The Src is the TextBox ID */
function PickDate(Src)
{
	window.open("../Calendar/Calendar.aspx?src=" + Src, "_blank", "height=280, width=220, left=100, top=100, " + "location=no, menubar=no, toolbar=no", true);
}

/* Open a new popup window x=10, y=10, size = 640x480 */
function OpenNew(url) {
	win = window.open(url, 'NewWindow', 'resizable,scrollbars=yes,status=no,titlebar=yes,toolbar=no,top=10,left=10,width=800,height=480')
	if (parseInt(navigator.appVersion) >= 4) { win.window.focus(); }
}

function OpenNewGeneric(url, feature)
{
	parent.openWins[parent.CurWin]=window.open(url,'NewWindow',feature);	//opens the child window and store it in an array
	parent.openWins[parent.CurWin].focus();
	parent.CurWin++

	//win = window.open(url, 'NewWindow', feature)
	//if (parseInt(navigator.appVersion) >= 4) { win.window.focus(); }
} 

function closeAll()
{
	if (parent.visitor_is_leaving)						//check if the user is leaving the website. If yes, loop into the array to close all the child nodes
	{	
		for (i=0;i<parent.openWins.length;i++)
			if (parent.openWins[i] && !parent.openWins[i].closed)
				parent.openWins[i].close();
	}
	parent.visitor_is_leaving=true;						//set back the flag to true
}

/* to hide or show the Content TD */
function showSelect(isOn) {
	//if(IE4) {					
		//document.getElementById("ContentDiv").style.visibility = isOn ? "visible" : "hidden";
	//}
	//else {
		//document.getElementById("ContentDiv").visibility = isOn ? "show" : "hide";
	//}
	var thisForm = document.forms[0]
	for(i=0;i<thisForm.elements.length;i++) {			
		if (thisForm.elements[i].type == "select-one") {
			thisForm.elements[i].style.visibility = isOn ? "visible" : "hidden";
		}			
	}
	
}


/* client side validation to check text length less than 50 */
function ValidateTextLength50(objSource, objArgs)
{
	if (objArgs.Value.length > 50)
	{
        objArgs.IsValid = false;
	}
	else
	{
		objArgs.IsValid = true;
	}
	return;
} 

/* client side validation to check text length less than 200 */
function ValidateTextLength200(objSource, objArgs)
{
	if (objArgs.Value.length > 200)
	{
        objArgs.IsValid = false;
	}
	else
	{
		objArgs.IsValid = true;
	}
	return;
} 

/* client side validation to check text length less than 250 */
function ValidateTextLength250(objSource, objArgs)
{
	if (objArgs.Value.length > 250)
	{
        objArgs.IsValid = false;
	}
	else
	{
		objArgs.IsValid = true;
	}
	return;
} 

/* client side validation to check text length less than 500 */
function ValidateTextLength500(objSource, objArgs)
{
	if (objArgs.Value.length > 500)
	{
        objArgs.IsValid = false;
	}
	else
	{
		objArgs.IsValid = true;
	}
	return;
} 

/* To submit only once. */
/* Use this if there is/are .net validator(s) in the page. */
var bCanSubmit;
bCanSubmit = true;
function CanSubmit(){ 
	if (Page_BlockSubmit == false) {		
		var cansubmit = bCanSubmit;
			if ( bCanSubmit == true )
			{ 
				bCanSubmit = false;
			}
			return cansubmit;
		}
		else {
			bCanSubmit = true;	
		}
	}

/* To submit only once. */
/* Use this is there is no .net validator used in the page.*/
var bCanSubmitEx;
bCanSubmitEx = true;
function CanSubmitEx()
{ 
	var cansubmit = bCanSubmitEx;
	if ( bCanSubmitEx == true )
	{ 
		bCanSubmitEx = false;
	}
	return cansubmit;
}


/* ask user for confirmation to delete */
function CanDelete() 
	{ 
		return confirm('Do you really want to delete?');
	}

/* ask user for customer confirmation */
function CustomConfirmation(text) 
	{ 
		if (text == null || text == "")
		{
			return confirm('Error! Please specify text');
		}
		else
		{			
			return confirm('Do you really want to ' + text + '?');
		}
	}

/*Ask user for confirmation message (Personalised message)*/
function ConfirmationMsg(text) 
	{ 
		if (text == null || text == "")
		{
			return confirm('Error! Please specify text');
		}
		else
		{			
			return confirm(text);
		}
	}
	
/* to check how many checkboxes within the page are selected*/	
function CheckNumCheckBox() 
{ 
	var checked = 0;
	for (var i=0; i<document.forms[0].elements.length; i++)
	{
		var e = document.forms[0].elements[i];
		if (e.type == 'checkbox' && e.checked == true)
		{
		checked = checked + 1;
		}
	}		
	if (checked > 1)
	{
		alert('Please do not select more than one checkbox.');
		Page_BlockSubmit = true;
		return false;
	}
	else
	{
		Page_BlockSubmit = false;
		return true;
	}		
}
		
/* to check all the checkbox within the page */
function CheckAll() {
	for (var i=0; i<document.forms[0].elements.length; i++)
		{
			var e = document.forms[0].elements[i];
			if (e.type == 'checkbox')
				{ e.checked = true; }
		}
}

/* to uncheck all the checkbox within the page */
function UnCheckAll() {
	for (var i=0; i<document.forms[0].elements.length; i++)	{
			var e = document.forms[0].elements[i];
			if (e.type == 'checkbox') { 
					//if (e.checked == true) {
						//e.checked = false;
					//}
				e.checked = false;
			}
		}
}

/* to validate an date in DD/MM/YYYY format. */
function ValidateDate(objSource, objArgs)
{
	var bInvalid = false;
	var	dateStr = objArgs.Value;
	
	if (dateStr.length == 0)
	{
        objArgs.IsValid = true;
		return;	
	}
	
	//alert(dateStr)
	// dateStr must be of format month day year with slashes
    // separating the parts. 
    
    var slash1 = dateStr.indexOf("/");
    if (slash1 == -1) 
    {
		var s = "Please use DD/MM/YYYY format. " + dateStr + " is not a valid date."
    	alert(s)
        objArgs.IsValid = false;
		return;
	}


    var dateDay = dateStr.substring(0, slash1)
    //alert(dateDay)

    var dateMonthAndYear = dateStr.substring(slash1+1, dateStr.length);
    var slash2 = dateMonthAndYear.indexOf("/");
    // if not a second slash, invalid date
    if (slash2 == -1)
    {
		var s = "Please use DD/MM/YYYY format. " + dateStr + " is not a valid date."
    	alert(s)
		objArgs.IsValid = false;
		return;
	}

    var dateMonth = dateMonthAndYear.substring(0, slash2);

    var dateYear = dateMonthAndYear.substring(slash2+1, dateMonthAndYear.length);

    if ( (dateMonth == "") || (dateDay == "") || (dateYear == "") ) 
    { 
		var s = "Please use DD/MM/YYYY format. " + dateStr + " is not a valid date."
    	alert(s)
		objArgs.IsValid = false;
		return;
	}
    
    if (dateDay.length > 2)
    {
		var s = "Please use 2-digit format for day. E.g 12/09/1933 and not 012/09/1933."
    	alert(s)
		objArgs.IsValid = false;
		return;
    }
    
    if (dateMonth.length > 2)
    {
		var s = "Please use 2-digit format for month. E.g 12/09/1933 and not 12/009/1933."
    	alert(s)
		objArgs.IsValid = false;
		return;
    }
  
    
    // if any non-digits in the month, invalid date
    for (var x=0; x < dateMonth.length; x++) 
    {
        var digit = dateMonth.substring(x, x+1);
        if ((digit < "0") || (digit > "9")) 
		{ 
			var s = "Please use DD/MM/YYYY format. " + dateStr + " is not a valid date."
    		alert(s)
			objArgs.IsValid = false;
			return;
		}
    }

    // convert the text month to a number
    var numMonth = 0;
    for (var x=0; x < dateMonth.length; x++) 
    {
        digit = dateMonth.substring(x, x+1);
        numMonth *= 10;
        numMonth += parseInt(digit);
    }
    if ((numMonth <= 0) || (numMonth > 12))
    {
    	alert("Please use DD/MM/YYYY format. You have entered an invalid month in " + dateStr + ".")         
		objArgs.IsValid = false;
		return;
	}
    
    // if any non-digits in the day, invalid date
    for (var x=0; x < dateDay.length; x++) 
    {
        digit = dateDay.substring(x, x+1);
        if ((digit < "0") || (digit > "9"))
		{ 
	    	alert("Please use DD/MM/YYYY format. You have entered an invalid day in " + dateStr + ".")    		
			objArgs.IsValid = false;
			return;
		}
    }
    // convert the text day to a number
    var numDay = 0;
    for (var x=0; x < dateDay.length; x++) 
    {
        digit = dateDay.substring(x, x+1);
        numDay *= 10;
        numDay += parseInt(digit);
    }
    if ((numDay <= 0) || (numDay > 31)) 
    {
     	alert("You have entered an invalid day in " + dateStr + ".")             
		objArgs.IsValid = false;
		return;
	}
    
    // February can't be greater than 29 (leap year calculation comes later)
    if ((numMonth == 2) && (numDay > 29)) 
    { 
    	alert("February does not have more than 29 days. " + dateStr + " is not a valid date.")             
		objArgs.IsValid = false;
		return;
	}
    
    // check for months with only 30 days
    if ((numMonth == 4) || (numMonth == 6) || (numMonth == 9) || (numMonth == 11)) 
    { 
        if (numDay > 30) 
		{ 
		    if (numMonth == 4)
		    {
		    	alert("April has only 30 days. " + dateStr + " is not a valid date.")             
		    }
		    else if (numMonth == 6)
		    {
		    	alert("June has only 30 days. " + dateStr + " is not a valid date.")             
		    }
		    else if (numMonth == 9)
		    {
		    	alert("September has only 30 days. " + dateStr + " is not a valid date.")             		    
		    }
		    else if (numMonth == 11)
		    {
		    	alert("November has only 30 days. " + dateStr + " is not a valid date.")             		    		    
		    } 

			objArgs.IsValid = false;
			return;
		}	
		
    }

    // if any non-digits in the year, invalid date
    for (var x=0; x < dateYear.length; x++) 
    {
        digit = dateYear.substring(x, x+1);
        if ((digit < "0") || (digit > "9")) 
		{ 
	    	alert("Please use DD/MM/YYYY format. " + dateStr + " contains an invalid year.")    
			objArgs.IsValid = false;
			return;
		}
    }
    // convert the text year to a number
    var numYear = 0;
    for (var x=0; x < dateYear.length; x++) 
    {
        digit = dateYear.substring(x, x+1);
        numYear *= 10;
        numYear += parseInt(digit);
    }

    // Year must be a 4-digit year
    if  (dateYear.length != 4)
    { 
    	alert("Please use 4 digits for year e.g. 1971 as in DD/MM/YYYY format.")        
		objArgs.IsValid = false;
		return;
	}
	
	// database contraint. 01/01/1900 to 06/06/2079
	// We limit user input to 01/01/1900 to 31/12/2050, inclusive.
	// see PoupuCalendar.aspx.vb's DayRender.
	// See PopupCalenedatDateBox.ascx's javascript validator.
    if ((numYear < 1900) || (numYear > 2050))
    {
    	alert("Valid date range is from 01/01/1900 to 31/12/2050." )             
		objArgs.IsValid = false;
		return;
	}

    // check for leap year if the month and day is Feb 29
    if ((numMonth == 2) && (numDay == 29)) 
    {
        var div4 = numYear % 4;
        var div100 = numYear % 100;
        var div400 = numYear % 400;
        // if not divisible by 4, then not a leap year so Feb 29 is invalid
        if (div4 != 0) 
		{ 
	    	alert("February in non-leap year has only 28 days. " + dateStr + " in not a valid date.")             
			objArgs.IsValid = false;
			return;
		}

        // at this point, year is divisible by 4. So if year is divisible by
        // 100 and not 400, then it's not a leap year so Feb 29 is invalid
        if ((div100 == 0) && (div400 != 0))
		{ 
	    	alert("February in non-leap year has only 28 days.  " + dateStr + " in not a valid date.")             		
			objArgs.IsValid = false;
			return;
		}
    }

    // date is valid
    //alert("end true")

	objArgs.IsValid = true;
	return;

} 


/* ContentAddEdit Finctions */

function DisableAllButton()
{
	var inputs = document.getElementsByTagName("input");
	for(var i=0;i<inputs.length;i++)
	{
		if (inputs[i].type == "submit")
		{
			setTimeout("document.forms[0]."+inputs[i].id+".disabled = true",100);
			setTimeout("document.forms[0]."+inputs[i].id+".disabled = false",4000);
		}
	}
}


function LoadFTB()
{
	showFlag = GetCookie("FTB") ;
	
	if(showFlag != null)
	{
		objTbl = document.getElementById("TRFTB");
		objHyperLink = document.getElementById("HyperLinkShowHideFTB");
		
		if(objTbl != null){
			
			objTbl.style.display=showFlag;
			
			if (objTbl.style.display=="none")
			{
				objHyperLink.innerText = "[Show]";
			}
			else
			{
				objHyperLink.innerText = "[Hide]";
			}
		}
	}
}


function LoadSEO()
{
	showFlag = GetCookie("SEO") ;
	
	if(showFlag != null)
	{
		objTbl = document.getElementById("TRSEO");
		objHyperLink = document.getElementById("HyperLinkShowHideSEO");
		
		if(objTbl != null){
		
			objTbl.style.display = showFlag;

			if (objTbl.style.display=="none")
			{
				objHyperLink.innerText = "[Show]";
			}
			else
			{
				objHyperLink.innerText = "[Hide]";
			}
		}
	}
}


function ShowHideFTB()
{
	objTbl = document.getElementById("TRFTB");
	objHyperLink = document.getElementById("HyperLinkShowHideFTB");
	
	if(objTbl != null){
	
		if (objTbl.style.display=="none")
		{
			objHyperLink.innerText = "[Hide]";
			objTbl.style.display="inline";
		}
		else
		{
			objHyperLink.innerText = "[Show]";
			objTbl.style.display="none";
		}
		SetCookie("FTB", objTbl.style.display);
	}
}


function ShowHideSEO()
{
	objTbl = document.getElementById("TRSEO");
	objHyperLink = document.getElementById("HyperLinkShowHideSEO");
	
	if(objTbl != null){
		if (objTbl.style.display=="none")
		{
			objHyperLink.innerText = "[Hide]";
			objTbl.style.display="inline";
		}
		else
		{
			objHyperLink.innerText = "[Show]";
			objTbl.style.display="none";
		}
		SetCookie("SEO", objTbl.style.display);
	}
}
function ContentTypeOnChange()
{
	var ddlType = document.getElementById("DropDownListContentType");
	var ddlSharedContent = document.getElementById("DropDownListSharedContent");
	var txtKey = document.getElementById("TextboxContentKey");
	var hdnField = document.getElementById("ShowSharedContentDD");
	
	if(ddlType != null)
		type = ddlType[ddlType.selectedIndex].value;
	else
		type= "NA";
	
	if (type == "SHAREDServ")
	{
		txtKey.style.display = 'none';
		ddlSharedContent.style.display = 'inline';
		hdnField.value = "Y";
	}
	else if (type == "GENERALSURVEY")
	{
		var row = document.getElementById("TRSurvey");
		if(row != null)
		{
			row.style.display = 'inline';
		}
	}
	else if(type != "NA")
	{
		var row = document.getElementById("TRSurvey");
		if(row != null)
		{
			row.style.display = 'none';
		}
		txtKey.style.display = 'inline';
		ddlSharedContent.style.display = 'none';
		hdnField.value = "N";
	}
}

function showRoles()
{
	var tbOthers = document.getElementById("TRRoles");	
	
	if(tbOthers != null)
	{
		tbOthers.style.display = 'block';
		tbOthers.focus();
	}	
}

function hideRoles()
{
	var tbOthers = document.getElementById("TRRoles");	
	if(tbOthers != null)
	{
		tbOthers.style.display = 'none';	
	}		
}

function LoadTemplate(){

	var templateId = document.getElementById('DropDownListTemplateType').options[document.getElementById('DropDownListTemplateType').selectedIndex].value;
	if(templateId == -1){
		alert('Please select a template to view.');
		return;
	}
		
	window.open('../Display/Templates/'+templateId+'.jpg', 'Template', 'resizable,scrollbars=yes,status=no,titlebar=yes,toolbar=no,top=10,left=10,width='+(screen.width-30));
}