
	
var pdItemTabVersion = "graphic";
function pditemdatatabs()
{
	var wrapper = document.getElementById("pditemdatatabs");
	if(wrapper)
	{
		 tabs = wrapper.getElementsByTagName("DIV");
		 for(i=0;i<tabs.length;i++)
		 {
			 var s = tabs[i].id;
			 var subs = s.substring(0,3)
			 if(subs == "tab")
			 {
	 //***************************************************
	//******* SET INITIAL STYLE FOR DEFAULT TAB *********
	 //***************************************************
	
	 //******* TURN ON A DEFAULT TAB *********
			 if(tabs[i].id == pdactiveitemdatatab)
			 {
				 tabs[i].className = "pditemtablinkon";
				 //****** SET TABLE CELL STYLE FOR GRAPHIC TAB EFFECT ***********//
				 if(pdItemTabVersion == "graphic"){document.getElementById(tabs[i].id).parentNode.className = "pditemlinkcellon";}
			 }
			 else
			 {
				 tabs[i].className = "pditemtablinkoff";
				 //****** SET TABLE CELL STYLE FOR GRAPHIC TAB EFFECT ***********//
				 if(pdItemTabVersion == "graphic"){document.getElementById(tabs[i].id).parentNode.className = "pditemlinkcelloff";}
			 }
			
			 //******* TURN OFF TAB IF THERE IS NO CONTENT *********
			 if(isBlank(document.getElementById(s + "content").innerHTML)){
			 tabs[i].className = "pditemtabdisable";
			 }
			
			if(tabs[i].id != "tabBlank"){
				 //******* MOUSEOVER EVENT ********//
					 tabs[i].onmouseover=function(){
												 this.className = "pditemtablinkon";
												if(pdItemTabVersion == "graphic"){this.parentNode.className ="pditemlinkcellon";}
													 }
					 //******* MOUSEOUT EVENT ********//
					 tabs[i].onmouseout=function(){
												if(pdactiveitemdatatab != this.id){
												this.className = "pditemtablinkoff";
												if(pdItemTabVersion == "graphic"){this.parentNode.className = "pditemlinkcelloff"}
												 }
												}
				 //******* ONCLICK EVENT ********//
				 tabs[i].onclick=function(){
											pdactiveitemdatatab = this.id;
											 //** RESET CONTENT DIVS AND TAB IMGS
											 resetItemDataTabs();
											 //** SET ON CLASSNAME
											 if(this.className != "pditemtabdisable")
											 {
												this.className = "pditemtablinkon";
												 if(pdItemTabVersion == "graphic"){this.parentNode.className = "pditemlinkcellon";}
											}
											 //** SET ON CONTENT
											 var elem = this.id;
											 document.getElementById(elem + "content").style.display = "block";
						 				}
						 if(tabs[i].id != pdactiveitemdatatab){
						 document.getElementById(tabs[i].id + "content").style.display = "none";
						 } 
						 }
		 }
	 }
 }
}

function resetItemDataTabs()
{
	 var itemDataTabs = document.getElementById("pditemdatatabs");
	 var tabs = itemDataTabs.getElementsByTagName("DIV");
	 for(i=0;i<tabs.length;i++)
	 {
		 var s = tabs[i].id;
		 var subs = s.substring(0,3)
		 if(subs == "tab")
		 {
			 if(tabs[i].className != "pditemtabdisable")
			 {
				tabs[i].className = "pditemtablinkoff";
				if(pdItemTabVersion == "graphic")
				{document.getElementById(tabs[i].id).parentNode.className = "pditemlinkcelloff";}
			 }
			 if(tabs[i].id != "tabBlank"){
				 document.getElementById(s + "content").style.display = "none";
				 }
		 }
	 }
}
function isBlank(item) 
{
	 item = String(item).toLowerCase();
	 if(item == "undefined" || item == "" || item == "null") return true;
	 else return false;
}


function imgrandom()
{
	data = new Array
	data[0]='apple-iphone-4-at-t-accessories'
	//data[1]='motorola-cliq-xt-t-mobile-accessories-motorola-zeppelin'
	//data[2] ='nokia-5230-nuron-t-mobile-accessories'
	data[1] ='htc-firestone-hd2-t-mobile-accessories-htc-leo'
	//data[4]='htc-mytouch-3g-fender-t-mobile-accessories'
	//data[5]='lg-cosmos-vn250-u-s-cellular-verizon-wireless-accessories'
	//data[6]='htc-mytouch-3g-slide-t-mobile-accessories'
	//data[7]='pantech-link-p7040-at-t-accessories'
	data[2]='motorola-devour-a555-verizon-wireless-accessories-motorola-calgary'
	//data[9]='samsung-a697-sunburst-at-t-accessories'
	//data[10]='htc-supersonic-evo-4g-sprint-accessories'
	//data[11]='apple-ipad-at-t-accessories'
	//data[3]='back-to-school'
	img=data[Math.floor(Math.random()*data.length)];
	document.write('<a href='+img+'.html><img width=\"626px\" height=\"200px\" src=\"http://site.wirester.com/banner/'+img+'.jpg\"></a>');
		
}
