﻿var URL = "http://www.yashirgroup.co.il/";
var relPath = "";    //"/";

$(document).ready(function() {

    var strWaterMark = $("#watermark").val();
    $("#q").Watermark(strWaterMark);
    //$('a[rel*=facebox]').facebox();
    $('a[rel*=popup]').popupWindow({ centerBrowser: 1, width: 510, height: 700, scrollbars: 1, scrollbars: 1, windowName: 'iso' });

    $("div.category_product_box").click(function() {
        window.location = $(this).find("a").attr("href"); return false;
    });

    //    $("div.provider_box").click(function() {
    //        window.location = $(this).find("a").attr("href"); return false;
    //    });

    $("div.article_box").click(function() {
        if(!$(this).find("a").attr("rel"))
            window.location = $(this).find("a").attr("href");
        else
            window.open($(this).find("a").attr("href")); 
        return false;
    });

    $("div.linkable").click(function() {
        window.location = $(this).find("a").attr("href"); return false;
    }).css({ 'cursor': 'pointer' });

});

function htmlToEncode(strVal) {
	encodedHtml = escape(strVal);
	encodedHtml = encodedHtml.replace(/\//g,"%2F");
	encodedHtml = encodedHtml.replace(/\?/g,"%3F");
	encodedHtml = encodedHtml.replace(/=/g,"%3D");
	encodedHtml = encodedHtml.replace(/&/g,"%26");
	encodedHtml = encodedHtml.replace(/@/g,"%40");
	//encodeHtml.htmlEncoded.value = encodedHtml;
	return encodedHtml;
}
