function getProperty (propName) {
	var props = new Array();
	props["extrasURL"] = "/extras";
	props["pageURL"] = "/home.aspx";
	return props[propName];
}

function Toggle(item) {
   obj=document.getElementById(item);
   icon=document.getElementById("cross_"+item);
   visible=(obj.style.display!="none")
   key=document.getElementById("x" + item);
   if (visible) {
     obj.style.display="none";
     icon.src="/extras/icons/down.jpg";

   } else {
      obj.style.display="block";
     icon.src="/extras/icons/up.jpg";
   }
}

function deleteItem(url,page){
	var answer = confirm ("Are you sure?");
	if (answer)	{
		if(page){document.location.href='/'+page+'?'+url;}
	  else {document.location.href='?'+url;}
	}
}

function popup(url,w,h,s,r){
	if(!w)w=700;if(!h)h=500;if(s==null)s="yes";if(r==null)r="yes";
	window.open(url,"Popup", "height="+h+",width="+w+",toolbar=no,location=no,status=no,menubar=no,scrollbars="+s+",resizable="+r);
}

var LayerCount = 0;
var myx=40;
var myy=35;
function createLayer(url,title){
	var t = title; if(t == null){t="Popup";}
	new popUp(myx ,document.body.scrollTop+myy, 600 , 580 , 'Layer'+LayerCount , url , 'white' , 'black' , '10px Verdana' , t , '#0F72BB' , 'white' , 'lightgrey', '#6DBAF3' , 'black' , true, true , false , true , true , false , '/extras/layer/min.gif' , '/extras/layer/max.gif' , '/extras/layer/close.gif' , '/extras/layer/resize.gif');
	//fadeboxin('Layer'+LayerCount);
	//document.body.scrollTop=0;
	myx=myx+20;myy=myy+20;
	LayerCount++;
}

function marqueefwd(obj){
	obj.scrollAmount=3;
	//obj.start;
	setTimeout(marqueestop(obj),100);
	//return true;
	
}

function marqueestop(obj){
	//obj.scrollAmount=1;
	obj.stop;
	//alert('in here');
	//return true;	
}

// Compatible with all major browsers for getting an instance of an object
function getItem(id){
    var itm = false;
    if(document.getElementById)itm = document.getElementById(id);
    else if(document.all)itm = document.all[id];
    else if(document.layers)itm = document.layers[id];
    return itm;
}

function getSelectVal (id){
    var item = getItem(id);
    return item.options[item.selectedIndex].value;
}
function openUmmahPages(){
	window.open('http://ummahpages.com/?business=&'+getSelectVal('category')+'&s=&location='+getItem('postal').value);
}
function ppinit(){
	if (typeof jQuery != 'undefined') { 
		$(document).ready(function(){$("a[rel^='prettyPhoto']").prettyPhoto({slideshow:5000, autoplay_slideshow:true});});
	} else {
		alert('doh!');
	}

}


// Check dynamically for use of prettyPhoto and load its libraries
aElements = document.getElementsByTagName("a");
relElems = [];
var doPrettyPhoto=0;
for (i = 0; i < aElements.length; i++) {
	if (aElements[i].getAttribute('rel') == "prettyPhoto" || aElements[i].getAttribute('rel') == "prettyPhotoFrame") {
		doPrettyPhoto=1;
	}
}

if(doPrettyPhoto){
	if (typeof jQuery != 'undefined') { 
		$(document).ready(function(){$("a[rel^='prettyPhoto']").prettyPhoto();});
	} else {
		alert('Feature Not Activated');
	}
}
	function prettyPhotoDynamicLoad(){

	if(doPrettyPhoto){
			var sc1 = document.createElement('script');sc1.src = 'http://code.jquery.com/jquery-1.4.4.min.js';
			var sc2 = document.createElement('script');sc2.src='/extras/prettyphoto/js/jquery.prettyPhoto.js';
			var sc3 = document.createElement('link');sc3.type='text/css';sc3.rel='stylesheet';sc3.href='/extras/prettyphoto/css/prettyPhoto.css';
			//if (typeof jQuery == 'undefined') {document.getElementsByTagName('head')[0].appendChild(sc1);}
			if (typeof jQuery != 'undefined'){document.getElementsByTagName('head')[0].appendChild(sc2);}
			setTimeout("ppinit();",500);
			document.getElementsByTagName('head')[0].appendChild(sc3);

	}

}
