/* 
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
/*Date:2009-11-9
 **Author:Zhang Qulin
 **Description:
 **Where To Use:home/feedback.html.erb
 */
function set_arrow_disable()
{
    $("blocker").innerHTML = "moving";
}
/*Date:2009-11-9
 **Author:Zhang Qulin
 **Description:
 **Where To Use:home/feedback.html.erb
 */
function set_arrow()
{
    if(up_or_down)
        operation_tag.className = "rightarrow";
    else
        operation_tag.className = "downarrow";
    $('blocker').innerHTML = "stop";

}
/*Date:2009-11-9
 **Author:Zhang Qulin
 **Description:
 **Where To Use:home/feedback.html.erb
 */
function message_diaplay(flag){
    if (flag){
        Element.removeClassName($('notice_message'), "hide");
        Element.addClassName($('error_message'), "hide");
    }else{
        Element.addClassName($('notice_message'), "hide");
        Element.removeClassName($('error_message'), "hide");
    }
}
/*Date:2009-11-9
 **Author:Zhang Qulin
 **Description:
 **Where To Use:home/feedback.html.erb
 */
function site_feedback_cancel(){
    $("leave_feedback_text").style.display="none";
    $("leave_feedback_img").className = "rightarrow";
}
/*Date:2009-11-9
 **Author:Wang Zhiping
 **Description:send email
 **Where To Use:home/forgot_password.html.erb
 *              home/sign_in.html.erb
 */
function send_email(){
    new Ajax.Request('/home/password_fogot',{
        method : 'post',
        parameters : "email="+$('useremail').value+ '&authenticity_token='+ encodeURIComponent(document.getElementsByName('authenticity_token').item(0).value) ,
        asynchronous: false
    });
    return true;
}
/*Date:2009-11-9
 **Author:Zhang Qulin
 **Description:
 **Where To Use:home/list_detail.html.erb
 */
function list_exchange_show(element_hide, element_show,class_hide ,class_show,label_hide,label_show){
    Element.addClassName($(element_hide), "hide");
    Element.removeClassName($(element_show), "hide");
    $(label_hide).className="hide";
    $(label_show).className="display";
    return false;
}
/*Date:2009-11-9
 **Author:Zhang Qulin
 **Description:
 **Where To Use:home/list_detail.html.erb
 */
function set_img_pointer(obj,img_pointer){
    if(obj == "featured_list"){
        $(img_pointer).style.left = getPosition($(obj))[1] -200+"px";
    }else{
        $(img_pointer).style.left = getPosition($(obj))[1]-285+"px";
    }
}
/*Date:2009-11-9
 **Author:Zhang Qulin
 **Description:
 **Where To Use:home/list_detail.html.erb
 */
function set_img_pointer1(obj,img_pointer){
    if(obj == "featured_list"){
        $(img_pointer).style.left = getPosition($(obj))[1] -216+"px";
    }else{
        $(img_pointer).style.left = getPosition($(obj))[1]-285+"px";
    }
}
/*Date:2009-11-9
 **Author:Cao Jinhua
 **Description:
 **Where To Use:home/index.html.erb
 */
function toBreakWord(intLen, id){
    var obj=document.getElementById(id);
    var strContent=obj.innerHTML;
    var strTemp="";
    while(strContent.length>intLen){
        strTemp+=strContent.substr(0,intLen)+"<wbr>";
        strContent=strContent.substr(intLen,strContent.length);
    }
    strTemp+= strContent;
    obj.innerHTML=strTemp;
}

/*Date:2009-02-05
**Author:
**Description:supplier，buyer 等等块的list中change the title color
**Where To Use:首页Supplier,Buyer等DIV,list_detail.html页面DIV
*modify 2009-02-05 WZ
*/
function onmoveorver_title(obj){
    Element.addClassName(obj,'list_title_over_word');
    if(Element.hasClassName(obj,'list_title_out_word'))Element.removeClassName(obj,'list_title_out_word');
    if(Element.hasClassName(obj,'list_title_out_word_2'))Element.removeClassName(obj,'list_title_out_word_2');
}
function onmouseout_title_2(obj){
    Element.addClassName(obj,'list_title_out_word_2');
    if(Element.hasClassName(obj,'list_title_over_word'))Element.removeClassName(obj,'list_title_over_word');
}
function onmouseout_title(obj){
    Element.addClassName(obj,'list_title_out_word');
    if(Element.hasClassName(obj,'list_title_over_word'))Element.removeClassName(obj,'list_title_over_word');
}
