﻿function getCookie(name){
        var strCookie=document.cookie;
        var start = strCookie.indexOf("money=name="); 
        if(start != -1){ 
        var num = start.Length; 
        var value = strCookie.substring(start + 11);
            value = value.substring(0,3);
        var obj = document.getElementById("currency");
        obj.innerText = value;
    }  
}
function serachcolor(){
    var x = document.getElementById("word");
    document.getElementById("word").value='';
    x.className = "search_input2";
}
function loginstr(){
//	var x = "uicook=";
//	var cook = document.cookie;
//	var num = cook.indexOf(x);
////	alert(cook);
//	if(num != -1){
//		return true;
//	}
//	else{
//		alert('You haven’t sign in or register.')
//	}
//	return false;
}

function Slide(_id)
{
    var arr = Array("home", "new", "recommendations", "hot", "feedback", "news");
 
    
    for(var i = 0; i < arr.length; i++)
    {
        if(arr[i] == _id)
        {             
            $(arr[i]).className = "slide_image";
        }
        else
        {
            $(arr[i]).className = "";
        }
    } 
}

function SearcWord()
{
	var word = document.getElementById("word").value;
    	var reg = /\s/g;  
    	word = word.replace(reg,"+");
	javascript:window.location.href="/search.aspx?word=" + word
}

function $(_id)
{
    return document.getElementById(_id);
}

function move(_index, _src)
{
    var count = 5;
    
    for(var i = 1; i <= count; i++)
    {
        if(i == _index)
        {
            $("ad_" + _index).style.backgroundImage = "url(/images/ad_box.png)";
            $("ad_img_" + _index).style.width = "70px";
            $("ad_img_" + _index).style.height = "52px";
            $("ad_img_" + _index).style.position = "relative";
            $("ad_img_" + _index).style.top = "2px";
            $("ad_img_" + _index).style.right = "2px"; 
            $("ad_img").src = _src;
            if(i == 1)
            {
                $("ab_url").href = "/products/Gossip-Girl-Season-4-DVD-Boxset-1160.html";
                $("ab_url").title = "Gossip Girl";
            }
            else if(i == 2)
            {
                $("ab_url").href = "/products/One-Tree-Hill-Season-8-DVD-Boxset-1267.html";
                $("ab_url").title = "One Tree Hill Season 8 DVD Boxset";
            }
            else if(i == 3)
            {
                $("ab_url").href = "/products/The-Vampire-Diaries-Seasons-1-2-DVD-Box-Set-1325.html";
                $("ab_url").title = "The Vampire Diaries Seasons 1-2 DVD Box Set";
            }
            else if(i == 4)
            {
                $("ab_url").href = "/products/Boardwalk-Empire-Seasons-1-2-DVD-Box-Set-2175.html";
                $("ab_url").title = "Boardwalk Empire Season 1-2 DVD Boxset";
            }
            else if(i == 5)
            {
                $("ab_url").href = "/products/Supernatural-Season-7-DVD-Box-Set-1865.html";
                $("ab_url").title = "Supernatural Seasons 1-6 DVD Box Set";
            }
        }
        else
        {
            $("ad_" + i).style.backgroundImage = "";
            $("ad_img_" + i).style.width = "72px";
            $("ad_img_" + i).style.height = "56px";
            
        }
    }
}
