function getURLParam(strParamName){
  var strReturn = "";
  var strHref = window.location.href;
  if ( strHref.indexOf("?") > -1 ){
    var strQueryString = strHref.substr(strHref.indexOf("?"));
    var aQueryString = strQueryString.split("&");
    for ( var iParam = 0; iParam < aQueryString.length; iParam++ ){
      if ( 
aQueryString[iParam].indexOf(strParamName + "=") > -1 ){
        var aParam = aQueryString[iParam].split("=");
        strReturn = aParam[1];
        break;
      }
    }
  }
  return unescape(strReturn);
}

function show_price_last_lvl(itemId)
{
//START show price and discount
var lblBasePrice_td = "itm_lblBasePrice" + itemId;
var valBasePrice_td = "itm_valBasePrice" + itemId;
var valBasePrice_value = new String(document.getElementById(valBasePrice_td).innerHTML);
valBasePrice_value = valBasePrice_value.substr(1);
valBasePrice_value = parseFloat(valBasePrice_value);

var lblSalesPrice_td = "itm_lblSalesPrice" + itemId;
var valSalesPrice_td = "itm_valSalesPrice" + itemId;

var lblSaving_td = "itm_lblSaving" + itemId;
var valSaving_td = "itm_valSaving" + itemId;

var lblOnlinePrice_td = "itm_lblOnlinePrice" + itemId;
var valOnlinePrice_td = "itm_valOnlinePrice" + itemId;
var valOnlinePrice_value = new String(document.getElementById(valOnlinePrice_td).innerHTML);
valOnlinePrice_value = valOnlinePrice_value.substr(1);
valOnlinePrice_value = parseFloat(valOnlinePrice_value);
if(valBasePrice_value > valOnlinePrice_value)//discount
{
document.getElementById(lblSalesPrice_td).className = "itm_cell_price";
document.getElementById(valSalesPrice_td).className = "itm_cell_price";

document.getElementById(lblBasePrice_td).className = "itm_cell_priceD";
document.getElementById(valBasePrice_td).className = "itm_cell_base_priceD";

document.getElementById(lblOnlinePrice_td).className = "itm_cell_priceD";
document.getElementById(valOnlinePrice_td).className = "itm_cell_discountD";

document.getElementById(lblSaving_td).className = "itm_cell_priceD";
document.getElementById(valSaving_td).className = "itm_cell_discountD";
document.getElementById(valSaving_td).innerHTML = "$" + (valBasePrice_value - valOnlinePrice_value).toFixed(2) + "(~" + (((valBasePrice_value-valOnlinePrice_value)/valBasePrice_value)*100).toFixed(0) + "%)";
}
else//no discount
{
document.getElementById(lblSalesPrice_td).className = "itm_cell_priceD";
document.getElementById(valSalesPrice_td).className = "itm_cell_priceD";
}
//END show price and discount
}

function show_promotion_lbl(itemId)
{
//START Show promotion label
var PLabelid = "PLabel" + itemId;
var promotion = "itm_PromotionLabel" + itemId;
var promotion_value = document.getElementById(promotion).value;
if(promotion_value != "")
{
document.getElementById(PLabelid).style.visibility = "visible";
}
//END Show promotion label
}

function show_price_main(itemId)
{
//START show price and discount
var valBasePrice_td = "itm_valBasePrice" + itemId;
var valBasePrice_value = new String(document.getElementById(valBasePrice_td).innerHTML);
valBasePrice_value = valBasePrice_value.substr(1);
valBasePrice_value = parseFloat(valBasePrice_value);


var valSalesPrice_td = "itm_valSalesPrice" + itemId;


var valOnlinePrice_td = "itm_valOnlinePrice" + itemId;
var valOnlinePrice_value = new String(document.getElementById(valSalesPrice_td).innerHTML);
valOnlinePrice_value = valOnlinePrice_value.substr(1);
valOnlinePrice_value = parseFloat(valOnlinePrice_value);
if(valBasePrice_value > valOnlinePrice_value)//discount
{
document.getElementById(valSalesPrice_td).className = "DDisplay";
document.getElementById(valBasePrice_td).className = "normal";
document.getElementById(valOnlinePrice_td).className = "normal";
}
//END show price and discount
}

function show_arabic_name(itemId)
{
var Ar_name = "itm_ArName" + itemId;
var Ar_name_value = document.getElementById(Ar_name).value;
var itm_URL = "itm_url" + itemId;
document.getElementById(itm_URL).innerHTML = document.getElementById(itm_URL).innerHTML + " " + Ar_name_value;
}

function items_banner()
{
var names = new Array("ana_muslim_cd.gif","we_love_mohammad_btn.jpg","quran_1_btn.jpg","quran_2_btn.jpg","quran_3_btn.jpg","we_r_muslim_1_btn.jpg","we_r_muslim_2_btn.jpg");
var links = new Array("Im-a-Muslim-Arabic-Version-Audio-CD","we_love_muhammad_life_in_mecca_vlm_1_dvd","quran_for_little_muslims_1_audio_cd","quran_for_little_muslims_2_audio_cd","quran_for_little_muslims_3_audio_cd","we_are_muslims_1_audio_cd","we_are_muslims_2_audio_cd");
var len = names.length;
var rnd = Math.floor(Math.random()*len);
document.write("<a href='http://www.noorart.com/"+links[rnd]+"'><img width='151' height='113' src='http://www.noorart.com/site/" + names[rnd] + "' border='0'/></a>");
}

function autoResizeIframe(id){
	var newheight;var newwidth;
	if(document.getElementById){
	    newheight=document.getElementById(id).contentWindow.document.body.scrollHeight;
	    newwidth=document.getElementById(id).contentWindow.document.body.scrollWidth;
	}
	document.getElementById(id).height= (newheight)
	    + "px";
	document.getElementById(id).width= (newwidth) + "px";
}
function MM_openBrWindow(theURL,winName,features) 
{ //v2.0
  window.open(theURL,winName,features);
}

