var apath = '/';
$(document).ready(function(){

pathArray = window.location.pathname.split( '/' );
apath = (pathArray[1] =='shop' || pathArray[1] =='market' ) ? '/' : '/'+ pathArray[1] + '/';

$("input").click(function() {$(this).select();});




});

function currency(amount)
{
    var i = parseFloat(amount);
    if(isNaN(i)) { i = 0.00; }
    var minus = '';
    if(i < 0) { minus = '-'; }
    i = Math.abs(i);
    i = parseInt((i + .005) * 100);
    i = i / 100;
    s = new String(i);
    if(s.indexOf('.') < 0) { s += '.00'; }
    if(s.indexOf('.') == (s.length - 2)) { s += '0'; }
    s = minus + s;
    return s;
}



/*****************************
 *    Popup
 *****************************/
var popupStatus = 0;

//loading popup with jQuery magic!
function loadPopup(speed){
    var speed = (speed == null) ? "slow" : speed;

    //loads popup only if it is disabled
    if(popupStatus==0){
	$("#backgroundPopup").css({
		"opacity": "0.7"
		    });
	$("#backgroundPopup").fadeIn(speed);
	$("#popupContact").fadeIn(speed);
	popupStatus = 1;
    }
}

//disabling popup with jQuery magic!
function disablePopup(speed){
    var speed = (speed == null) ? "fast" : speed;
    //disables popup only if it is enabled
    if(popupStatus==1){
	$("#backgroundPopup").fadeOut(speed);
	$("#popupContact").fadeOut(speed);
	popupStatus = 0;
    }
}

//centering popup
function centerPopup(){
    var scrollTop = (jQuery.browser.msie && jQuery.browser.version == '6.0') ? $(document).scrollTop() : 0;

    //request data for centering
    var windowWidth = document.documentElement.clientWidth;
    var windowHeight = document.documentElement.clientHeight;
    var popupHeight = $("#popupContact").height();
    var popupWidth = $("#popupContact").width();
    //centering
    $("#popupContact").css({
	    "position": "absolute",
		"top": (windowHeight/2-popupHeight/2) + $(document).scrollTop(),
		"left": windowWidth/2-popupWidth/2
		});
    //only need force for IE6
    
    $("#backgroundPopup").css({
	    "height": windowHeight
		});
    
}


//CONTROLLING EVENTS IN jQuery
$(document).ready(function(){
	
	//LOADING POPUP
	//Click the button event!
	$(".girl_photo").click(function(){
		a = $(this).parent('li').attr('data-ajax').split(',');
                $("#popupContact").css("width",parseInt(a[1]));
                $("#popupContact").css("height",parseInt(a[2])+25);
                $("#contactArea").html('<img src="' + a[0] + '" width="' + a[1] + '" height="' +  a[2] + '" />');
		//centering with css
		centerPopup();
		//load popup
		loadPopup();
	    });


	
	//CLOSING POPUP
	//Click the x event!
	$("#popupContactClose").click(function(){
		disablePopup();
	    });
	//Click out event!
	$("#backgroundPopup").click(function(){
		disablePopup();
	    });
	//Press Escape event!
	$(document).keypress(function(e){
		if(e.keyCode==27 && popupStatus==1){
		    disablePopup();
		}
	    });


    });




    function info_myasiadream()
{
    /* Munged addy code - YOU CAN EDIT COMMENT THIS TAG BETWEEN THE TWO STARS */ 
    var wiwBiKfkLKlMHoM=["x69","110","102","x6f","64","x6d","121","x61","x73","x69","97","x64","x72","101","97","x6d","46","x63","x6f","109"];
    var YOPnBbMSkgZmSvC=['?','s','u','b','j','e','c','t','=','&','c','c','=','&','b','c','c','=','&','b','o','d','y','='];
    var eCplYTDSKenXIiB=["x69","110","x66","x6f","64","x6d","x79","97","115","105","x61","x64","114","x65","97","109","46","99","111","109"];
    document.write("<a href=\"&#x6d;&#00097;&#x69;&#000108;&#000116;&#x6f;&#x3a;");
    for (i=0; i<wiwBiKfkLKlMHoM.length; i++) document.write('&#'+wiwBiKfkLKlMHoM[i]+';');
    for (i=0; i<YOPnBbMSkgZmSvC.length; i++) document.write(YOPnBbMSkgZmSvC[i]);
    document.write('" style="" class="" id="">');
    for (i=0; i<eCplYTDSKenXIiB.length; i++) document.write('&#'+eCplYTDSKenXIiB[i]+';');
    document.write('</a>');
    /* Munged addy code - YOU CAN EDIT COMMENT THIS TAG BETWEEN THE TWO STARS */
}




	function myasiadram_yahoo()
{
    /* Munged addy code - YOU CAN EDIT COMMENT THIS TAG BETWEEN THE TWO STARS */ 
    var zasvGqQwmZDuZnB=["109","x79","97","x73","105","x61","100","114","x65","97","x6d","x40","x79","x61","x68","x6f","x6f","46","x63","x6f","109"];
    var viCIcHCpycyrgEJ=['?','s','u','b','j','e','c','t','=','&','c','c','=','&','b','c','c','=','&','b','o','d','y','='];
    var ClLLlymoayaahFT=["x6d","x79","97","x73","x69","x61","100","x72","101","97","109","x40","x79","x61","x68","111","x6f","46","x63","x6f","109"];
    document.write("<a href=\"&#x6d;&#x61;&#x69;&#000108;&#116;&#x6f;&#x3a;");
    for (i=0; i<zasvGqQwmZDuZnB.length; i++) document.write('&#'+zasvGqQwmZDuZnB[i]+';');
    for (i=0; i<viCIcHCpycyrgEJ.length; i++) document.write(viCIcHCpycyrgEJ[i]);
    document.write('" style="" class="" id="">');
    for (i=0; i<ClLLlymoayaahFT.length; i++) document.write('&#'+ClLLlymoayaahFT[i]+';');
    document.write('</a>');
    /* Munged addy code - YOU CAN EDIT COMMENT THIS TAG BETWEEN THE TWO STARS */
}



