﻿var payak_GlobalEditControl=null;
var payak_GlobalMenuItemId=0;
var payak_GlobalSelectControlForEdit=false;

//Iframe top offset
function getOffsetTop(elm){
	return 0;
}

//Iframe left offset
function getOffsetLeft(elm){
	return 0;
}

//show edit wnd
function payakShowEditWnd(elm, contentTypeName, controlId, position, contentId){
}

//hide edit wnd
function payakHideEditWnd(){
}

function popUp(url) {
    OpenWin = this.open(url, "GoMacedoniaPopUp", "width=300,height=300,toolbar=no,menubar=yes,location=no,scrollbars=yes,resizable=yes");
}

function fillPage(url, ev, title) {
    var name;
    var pic;
    var poc;

    ev.target = 'addInfoName';
    if (url.indexOf(",") < 0) {
        name = url;
        pic = "";
 
    }
    else {
        name = url.substring(0, url.indexOf(","))
        pic = url.substring(url.indexOf(",") + 1);
        poc = pic.substring(0, pic.indexOf("upload"));
        pic = pic.substring(pic.indexOf("upload"))

    }
 

   
   

    if (pic != "") {
        document.getElementById('ContentContainer5_ctl00_imgProduct').src = poc + "getImageThumbnail.axd?imgPath=" + pic + "&imgSize=270&cropH=270";
        document.getElementById('ContentContainer5_ctl00_imgPopUp').href =poc + "getImageThumbnail.axd?imgPath=" + pic + "&imgSize=500&cropH=500";
        if (title != null && title.length > 0) document.getElementById('ContentContainer5_ctl00_imgPopUp').title = title;
    } else {
        document.getElementById('ContentContainer5_ctl00_imgProduct').src = document.getElementById('ContentContainer5_ctl00_imgCampaingBig').src.replace("=50", "=270").replace("=50", "=270");
        document.getElementById('ContentContainer5_ctl00_imgPopUp').href = document.getElementById('ContentContainer5_ctl00_hlCampaingBig').href;
        document.getElementById('ContentContainer5_ctl00_imgPopUp').title = document.getElementById('ContentContainer5_ctl00_hlCampaingBig').title;

 	pic = document.getElementById('ContentContainer5_ctl00_hlCampaingBig').href;
        poc = pic.substring(0, pic.indexOf("getImageThumbnail.axd"));
    }


  //  alert(document.getElementById('addInfo').src);

   // document.getElementById('addInfo').src = name.replace(".html", ".axd").replace(".aspx", ".axd");
    document.getElementById('addInfo').src = poc + "popUpPages.axd?pagePath=" + name;

//    alert(document.getElementById('addInfo').src);

    window.scrollTo(0, 450);
    setAllImage(null);
}
